One third of the world's population is infected with Mycobacterium tuberculosis (Mtb). Although most infected people remain asymptomatic, they have a 10% lifetime risk of developing active tuberculosis (TB). Thus, the current challenge is to identify immune parameters that distinguish individuals with latent TB from those with active TB. Using human and experimental models of Mtb infection, we demonstrated that organized ectopic lymphoid structures containing CXCR5+ T cells were present in Mtb-infected lungs. In addition, we found that in experimental Mtb infection models, the presence of CXCR5+ T cells within ectopic lymphoid structures was associated with immune control. Furthermore, in a mouse model of Mtb infection, we showed that activated CD4+CXCR5+ T cells accumulated in Mtb-infected lungs and produced proinflammatory cytokines. Mice deficient in Cxcr5 had increased susceptibility to TB due to defective T cell localization within the lung parenchyma. We demonstrated that CXCR5 expression in T cells mediated correct T cell localization within TB granulomas, promoted efficient macrophage activation, protected against Mtb infection, and facilitated lymphoid follicle formation. These data demonstrate that CD4+CXCR5+ T cells play a protective role in the immune response against TB and highlight their potential use for future TB vaccine design and therapy.