Although many studies indicate the interplay of genetic and environmental factors in the etiology of autism spectrum disorder (ASD), our limited understanding of the underlying mechanisms hampers the development of effective ways of detecting and preventing the disorder. Recent studies support the hypothesis that prenatal androgen exposure contributes to the development of ASD. This would suggest that maternal polycystic ovary syndrome (PCOS), a condition associated with excess androgens, would increase the risk of ASD in the offspring. We conducted a matched case-control study nested within the total population of Sweden (children aged 4–17 who were born in Sweden from 1984 to 2007). The sample consisted of 23 748 ASD cases and 208 796 controls, matched by birth month and year, sex and region of birth. PCOS and ASD were defined from ICD codes through linkage to health-care registers. Maternal PCOS increased the odds of ASD in the offspring by 59%, after adjustment for confounders (odds ratio (OR) 1.59, 95% confidence interval (CI) 1.34–1.88). The odds of offspring ASD were further increased among mothers with both PCOS and obesity, a condition common to PCOS that is related to more severe hyperandrogenemia (OR 2.13, 95% CI 1.46–3.10). Risk estimates did not differ between sexes. In conclusion, children of women with PCOS appear to have a higher risk of developing ASD. This finding awaits confirmation, and exploration of potentially underlying mechanisms, including the role of sex steroids in the etiology of ASD.