Compartmentalized inflammation is a key driver of multiple sclerosis (MS) progression, but the mechanisms sustaining its persistence remain unclear. A hallmark of this persistent and slowly evolving inflammatory process is chronic active MS lesions. We generated a high-resolution, single-cell molecular and spatial atlas of such lesions by combining single-nucleus RNA sequencing (snRNA-seq) with multiplexed error-robust fluorescence in situ hybridization (MERFISH). Within lesion rims, we identified CD8+ T cell niches associated with inflamed microglia displaying an interferon response and upregulated lipid metabolism. To investigate their function, we deleted ATP-binding cassette transporters A1 and G1 (ABCA1/G1) in the microglia of mice with experimental autoimmune encephalomyelitis (EAE), which increased the formation of lipid-storing phagocytes that amplified inflammation. Moreover, pharmacologically targeting sterol metabolism mitigated foam cell formation and inflammatory demyelination in EAE. Thus, our high-resolution map of immune niches in chronic active MS lesions identifies a role for lipid-storing, dysfunctional microglia in persistent neuroinflammation.