Microglia, the brain’s resident immune cells, can keep a dormant virus in check while damaging synapses. A team led by Ilija Brizić at the University of Rijeka in Croatia infected newborn mice with mouse cytomegalovirus. This herpesvirus goes latent in the brain after the first infection. Months later, the animals’ microglia were still activated. Interferon-γ made by memory T cells lodged in the brain drove this lasting state and broadly reprogrammed microglial gene activity. The primed microglia controlled the latent virus better. Yet they stripped dendritic spines from neurons in the hippocampal CA1 region. Infected mice did worse at spatial learning. Removing microglia prevented the synapse loss, and this pruning did not depend on interferon-γ. Tissue from human fetuses with congenital cytomegalovirus showed similar microglial activation. Roughly 0.6% of babies are born with the infection, but the learning deficit so far comes only from mice.