Ageing is characterized by the development of persistent pro-inflammatory responses that contribute to atherosclerosis, metabolic syndrome, cancer and frailty1-3. The ageing brain is also vulnerable to inflammation, as demonstrated by the high prevalence of age-associated cognitive decline and Alzheimer's disease4-6. Systemically, circulating pro-inflammatory factors can promote cognitive decline7,8, and in the brain, microglia lose the ability to clear misfolded proteins that are associated with neurodegeneration9,10. However, the underlying mechanisms that initiate and sustain maladaptive inflammation with ageing are not well defined. Here we show that in ageing mice myeloid cell bioenergetics are suppressed in response to increased signalling by the lipid messenger prostaglandin E2 (PGE2), a major modulator of inflammation11. In ageing macrophages and microglia, PGE2 signalling through its EP2 receptor promotes the sequestration of glucose into glycogen, reducing glucose flux and mitochondrial respiration. This energy-deficient state, which drives maladaptive pro-inflammatory responses, is further augmented by a dependence of aged myeloid cells on glucose as a principal fuel source. In aged mice, inhibition of myeloid EP2 signalling rejuvenates cellular bioenergetics, systemic and brain inflammatory states, hippocampal synaptic plasticity and spatial memory. Moreover, blockade of peripheral myeloid EP2 signalling is sufficient to restore cognition in aged mice. Our study suggests that cognitive ageing is not a static or irrevocable condition but can be reversed by reprogramming myeloid glucose metabolism to restore youthful immune functions.