Experimental and epidemiological evidence suggest that modifiable lifestyle factors, including physical exercise, can build structural and cognitive reserve in the brain, increasing resilience to injury and insult. Accordingly, exercise can reduce the increased expression of proinflammatory cytokines in the brain associated with ageing or experimentally induced neuroinflammation. However, the cellular mechanisms by which exercise exerts this effect are unknown, including the effects of exercise on classic or alternative activation of astrocytes and microglia. In the present study, we assess the effects of nine consecutive days of treadmill running on the glial cell response to a single systemic injection of lipopolysaccharide (LPS) and, in parallel, the effects on spatial learning and memory. We show that prior exercise protects against LPS-induced impairment of performance in the object displacement task concomitant with attenuation of IL-1β, TNFα and IL-10 mRNA expression in the hippocampus. Assessment of isolated astrocytes and microglia revealed that LPS induced a proinflammatory response in these cells that was not observed in cells prepared from the brains of mice who had undergone prior exercise. The results suggest that exercise modulates neuroinflammation by reducing the proinflammatory microglial response, suggesting a mechanism by which exercise may be neuroprotective.