Viral infection during pregnancy has been correlated with increased frequency of autism spectrum disorder (ASD) in offspring. This observation has been modeled in rodents subjected to maternal immune activation (MIA). The immune cell populations critical in the MIA model have not been identified. Using both genetic mutants and blocking antibodies in mice, we show that retinoic acid receptor-related orphan nuclear receptor gamma t (RORγt)-dependent effector T lymphocytes [for example, T helper 17 (TH17) cells] and the effector cytokine interleukin-17a (IL-17a) are required in mothers for MIA-induced behavioral abnormalities in offspring. We find that MIA induces an abnormal cortical phenotype, which is also dependent on maternal IL-17a, in the fetal brain. Our data suggest that therapeutic targeting of TH17 cells in susceptible pregnant mothers may reduce the likelihood of bearing children with inflammation-induced ASD-like phenotypes.