Provided is a pharmaceutical formulation and a method associated therewith for treating bacterial vaginosis. The pharmaceutical formulation includes from 10 to 25 weight parts of poloxamer F127, from 0.5 to 3.0 weight parts of xanthan gum, from 70 to 90 weight parts of water, and a therapeutically effective amount of a pharmaceutical active ingredient. The pharmaceutical formulation may also include from 0.5 to 1.5 weight parts of benzyl alcohol.