Cellular senescence, a state of irreversible cell-cycle arrest caused by a variety of cellular stresses, is critically involved in age-related tissue dysfunction in various organs. However, the features of cells in the central nervous system that undergo senescence and their role in neural impairment are not well understood as yet. Here, through comprehensive investigations utilising single-cell transcriptome analysis and various mouse models, we show that microglia, particularly in the white matter, undergo cellular senescence in the brain and spinal cord during ageing and in disease models involving demyelination. Microglial senescence is predominantly detected in disease-associated microglia, which appear in ageing and neurodegenerative diseases. We also find that commensal bacteria promote the accumulation of senescent microglia and disease-associated microglia during ageing. Furthermore, knockout of p16INK4a, a key senescence inducer, ameliorates the neuroinflammatory phenotype in damaged spinal cords in mice. These results advance our understanding of the role of cellular senescence in the central nervous system and open up possibilities for the treatment of age-related neural disorders.