Bacteria, exemplified by enteropathogenic Escherichia coli (E. coli), rely on elaborate acid resistance systems to survive acidic environment (such as the stomach). Comprehensive understanding of bacterial acid resistance is important for prevention and clinical treatment. In this study, we report a previously uncharacterized type of acid resistance system in E. coli that relies on L-glutamine (Gln), one of the most abundant food-borne free amino acids. Upon uptake into E. coli, Gln is converted to L-glutamate (Glu) by the acid-activated glutaminase YbaS, with concomitant release of gaseous ammonia. The free ammonia neutralizes proton, resulting in elevated intracellular pH under acidic environment. We show that YbaS and the amino acid antiporter GadC, which exchanges extracellular Gln with intracellular Glu, together constitute an acid resistance system that is sufficient for E. coli survival under extremely acidic environment.