Maternal immune activation (MIA) during pregnancy increases the risk of neurodevelopmental disorders in offspring, but how embryos detect MIA has been unclear. Now, Paola Arlotta and colleagues profile the transcriptome of developing mouse brains during pathogen-free (polyinosinic:polycytidylic acid-induced) MIA. They show that embryonic microglia, the immune cells of the brain, are poised to respond to infection because they express pathogen and inflammatory signal (e.g. cytokine) receptors. During MIA, embryonic neurons and neuronal progenitors decrease expression of proliferation-, energy metabolism- and protein catabolism-associated genes. Importantly, genetic (Csf1r-null) ablation of embryonic microglia prevents such changes, indicating that microglia alone react to MIA and then induce changes in brain cells. Finally, the characteristics of microglia in offspring, such as proliferation and receptor expression, change in response to MIA and persist postnatally. Together, these data show that there are long-term fetal responses to MIA that are microglia dependent.