Protective immunity against pulmonary tuberculosis (TB) is characterized by the formation in the lungs of granulomas consisting of macrophages and activated T cells producing tumor necrosis factor alpha and gamma interferon, both required for the activation of the phagocytes. In 90% of immunocompetent humans, this response controls the infection. To understand why immunity fails in the other 10%, we studied the lungs of six patients who underwent surgery for incurable TB. Histologic examination of different lung lesions revealed heterogeneous morphology and distribution of acid-fast bacilli; only at the surface of cavities, i.e., in granulomas with a patent connection to the airways, were there numerous bacilli. The mutation profile of the isolates suggested that a single founder strain of Mycobacterium tuberculosis may undergo genetic changes during treatment, leading to acquisition of additional drug resistance independently in discrete physical locales. Additional drug resistance was preferentially observed at the cavity surface. Cytokine gene expression revealed that failure to control the bacilli was not associated with a generalized suppression of cellular immunity, since cytokine mRNA was up regulated in all lesions tested. Rather, a selective absence of CD4(+) and CD8(+) T cells was noted at the luminal surface of the cavity, preventing direct T-cell-macrophage interactions at this site, probably allowing luminal phagocytes to remain permissive for bacillary growth. In contrast, in the perinecrotic zone of the granulomas, the two cell types colocalized and bacillary numbers were substantially lower, suggesting that in this microenvironment an efficient bacteriostatic or bactericidal phagocyte population was generated.