Some studies suggest that prenatal infection increases risk of autism spectrum disorders (ASDs). This study was undertaken in a prospective cohort in Norway to examine whether we could find evidence to support an association of the prenatal occurrence of fever, a common manifestation of infection, with ASD risk. Prospective questionnaires provided maternal exposure data; case status was established from clinical assessments and registry linkages. In a large, prospectively ascertained cohort of pregnant mothers and their offspring, we examined infants born ⩾32 weeks for associations between fever exposure in each trimester and ASD risk using logistic regression. Maternal exposure to second-trimester fever was associated with increased ASD risk, adjusting for presence of fever in other trimesters and confounders (adjusted odds ratio (aOR), 1.40; 95% confidence interval, 1.09-1.79), with a similar, but nonsignificant, point estimate in the first trimester. Risk increased markedly with exposure to three or more fever episodes after 12 weeks' gestation (aOR, 3.12; 1.28-7.63). ASD risk appears to increase with maternal fever, particularly in the second trimester. Risk magnified dose dependently with exposure to multiple fevers after 12 weeks' gestation. Our findings support a role for gestational maternal infection and innate immune responses to infection in the pathogenesis of at least some cases of ASD.