BACKGROUNDWhich cell populations that determine the fate of bacteria in infectious granulomas remain unclear. Leprosy, a granulomatous disease with a strong genetic predisposition, caused by Mycobacterium leprae infection, exhibits distinct sub-types with varying bacterial load and is considered an outstanding disease model for studying host-pathogen interactions.METHODSWe performed single-cell RNA and immune repertoire sequencing on 11 healthy controls and 20 patients with leprosy, and integrated single-cell data with genome-wide genetic data on leprosy. Multiplex immunohistochemistry, and in vitro and in vivo infection experiments were conducted to confirm the multimodal omics findings.FINDINGSLepromatous leprosy (L-LEP) granulomas with high bacterial burden were characterised by exhausted CD8+ T cells, and high RGS1 expression in CD8+ T cells was associated with L-LEP. By contrast, tuberculoid leprosy (T-LEP) granulomas with low bacterial burden displayed enrichment in resident memory IFNG+ CD8+ T cells (CD8+ Trm) with high GNLY expression. This enrichment was potentially attributable to the communication between IL1B macrophages and CD8+ Trm via CXCL10-CXCR3 signalling. Additionally, IL1B macrophages in L-LEP exhibited anti-inflammatory phenotype, with high APOE expression contributing to high bacterial burden. Conversely, IL1B macrophages in T-LEP were distinguished by interferon-γ induced GBP family genes.INTERPRETATIONThe state of IL1B macrophages and functional CD8+ T cells, as well as the relationship between them, is crucial for controlling bacterial persistence within granulomas. These insights may indicate potential targets for host-directed immunotherapy in granulomatous diseases caused by mycobacteria and other intracellular bacteria.FUNDINGThe Key research and development program of Shandong Province (2021LCZX07), Natural Science Foundation of Shandong Province (ZR2023MH046), Youth Science Foundation Cultivation Funding Plan of Shandong First Medical University (Shandong Academy of Medical Sciences) (202201-123), National Natural Science Foundation of China (82471800, 82230107, 82273545, 82304039), the China Postdoctoral Science Foundation (2023M742162), Shandong Province Taishan Scholar Project (tspd20230608), Joint Innovation Team for Clinical & Basic Research (202410), Central guidance for local scientific and technological development projects of Shandong Province (YDZX2023058).