MdfA is an Escherichia coli multidrug-resistance transporter. Cells expressing MdfA from a multicopy plasmid exhibit multidrug resistance against a diverse group of toxic compounds. In this article, we show that, in addition to its role in multidrug resistance, MdfA confers extreme alkaline pH resistance and allows the growth of transformed cells under conditions that are close to those used normally by alkaliphiles (up to pH 10) by maintaining a physiological internal pH. MdfA-deleted E. coli cells are sensitive even to mild alkaline conditions, and the wild-type phenotype is restored fully by MdfA expressed from a plasmid. This activity of MdfA requires Na(+) or K(+). Fluorescence studies with inverted membrane vesicles demonstrate that MdfA catalyzes Na(+)- or K(+)-dependent proton transport, and experiments with reconstituted proteoliposomes confirm that MdfA is solely responsible for this phenomenon. Studies with multidrug resistance-defective MdfA mutants and competitive transport assays suggest that these activities of MdfA are related. Together, the results demonstrate that a single protein has an unprecedented capacity to turn E. coli from an obligatory neutrophile into an alkalitolerant bacterium, and they suggest a previously uncharacterized physiological role for MdfA in pH homeostasis.