Oligodendrocytes myelinate axons for rapid impulse conduction and contribute to normal axonal functions in the central nervous system. In multiple sclerosis, demyelination is caused by autoimmune attacks, but the role of oligodendroglial cells in disease progression and axon degeneration is unclear. Here we show that oligodendrocytes harbor peroxisomes whose function is essential for maintaining white matter tracts throughout adult life. By selectively inactivating the import factor PEX5 in myelinating glia, we generated mutant mice that developed normally, but within several months showed ataxia, tremor and premature death. Absence of functional peroxisomes from oligodendrocytes caused widespread axonal degeneration and progressive subcortical demyelination, but did not interfere with glial survival. Moreover, it caused a strong proinflammatory milieu and, unexpectedly, the infiltration of B and activated CD8+ T cells into brain lesions. We conclude that peroxisomes provide oligodendrocytes with an essential neuroprotective function against axon degeneration and neuroinflammation, which is relevant for human demyelinating diseases.