Age-related microglial activation is associated with cognitive impairment. Tonicity-responsive enhancer-binding protein (TonEBP) is a critical mediator of microglial activation in response to neuroinflammation. However, the precise role of TonEBP in the middle-aged brain is not yet known. We used TonEBP haploinsufficient mice to investigate the role of TonEBP in middle-aged or amyloid β oligomer (AβO)–injected brains and examined the effect of TonEBP knockdown on AβO-treated BV2 microglial cells. Consistent with an increase in microglial activation with aging, hippocampal TonEBP expression levels were increased in middle-aged (12-month-old) and old (24-month-old) mice compared with young (6-month-old) mice. Middle-aged TonEBP haploinsufficient mice showed reduced microglial activation and fewer memory deficits than wild-type mice. Electron microscopy revealed that synaptic pruning by microglial processes was reduced by TonEBP haploinsufficiency. TonEBP haploinsufficiency also reduced dendritic spine loss and improved memory deficits in AβO-treated mice. Furthermore, TonEBP knockdown attenuated migration and phagocytosis in AβO-treated BV2 cells. These findings suggest that TonEBP plays important roles in age-related microglial activation and memory deficits.