Acidification of the phagosome is considered to be a major mechanism used by macrophages against bacteria, including Mycobacterium tuberculosis (Mtb). Mtb blocks phagosome acidification, but interferon-gamma (IFN-gamma) restores acidification and confers antimycobacterial activity. Nonetheless, it remains unclear whether acid kills Mtb, whether the intrabacterial pH of any pathogen falls when it is in the phagosome and whether acid resistance is required for mycobacterial virulence. In vitro at pH 4.5, Mtb survived in a simple buffer and maintained intrabacterial pH. Therefore, Mtb resists phagolysosomal concentrations of acid. Mtb also maintained its intrabacterial pH and survived when phagocytosed by IFN-gamma-activated macrophages. We used transposon mutagenesis to identify genes responsible for Mtb's acid resistance. A strain disrupted in Rv3671c, a previously uncharacterized gene encoding a membrane-associated protein, was sensitive to acid and failed to maintain intrabacterial pH in acid in vitro and in activated macrophages. Growth of the mutant was also severely attenuated in mice. Thus, Mtb is able to resist acid, owing in large part to Rv3671c, and this resistance is essential for virulence. Disruption of Mtb's acid resistance and intrabacterial pH maintenance systems is an attractive target for chemotherapy.