IMPORTANCE Whether individuals with autism spectrum disorder (ASD) are at increased risk for nonaffective psychotic disorder (NAPD) or bipolar disorder (BD) is unknown. OBJECTIVE To test whether the risks for NAPD and BD in individuals with ASD are increased and whether these risks are higher than those of their siblings not diagnosed as having ASD. DESIGN, SETTING, AND PARTICIPANTS We performed a nested case-control study of all individuals 17 years or younger who ever resided in Stockholm County, Sweden, from January 1, 2001, through December 31, 2011 (Stockholm Youth Cohort). We included cohort members ever diagnosed as having ASD (n = 9062) and their full siblings never diagnosed as having ASD. Each case was matched with 10 control individuals of the same sex born during the same month and year. Using Swedish registers, cases, siblings, and controls were followed up until December 31, 2011. By then, the oldest individuals had reached the age of 27 years. EXPOSURES Autism spectrum disorder, registered before age 16 or 28 years. We distinguished between ASD with and without intellectual disability (ID). MAIN OUTCOMES AND MEASURES We calculated odds ratios (ORs) for NAPD and BD adjusted for age, sex, population density of place of birth, personal or parental history of migration, hearing impairment, parental age, parental income, parental educational level, and parental history of psychiatric disorder. RESULTS The adjusted ORs for NAPD and BD for cases with non-ID ASD registered before age 16 years were 5.6 (95% CI, 3.3-8.5) and 5.8 (95% CI, 3.9-8.7), respectively; the adjusted ORs for cases with ID ASD were 3.5 (95% CI, 2.0-6.0) and 1.8 (95% CI, 0.8-4.1). The adjusted ORs for NAPD and BD in cases with non-ID ASD registered before age 28 years were 12.3 (95% CI, 9.5-15.9) and 8.5 (95% CI, 6.5-11.2), respectively; for cases with ID ASD, these ORs were 6.4 (95% CI, 4.2-9.8) and 2.0 (95% CI, 1.0-3.9), respectively. The ORs for NAPD and BD for the nonautistic full siblings of cases for whom ASD was registered before age 16 years, adjusted for hearing loss, were 1.8 (95% CI, 1.1-2.7) and 1.7 (95% CI, 1.1-2.6), respectively. CONCLUSIONS AND RELEVANCE A diagnosis of ASD is associated with a substantially increased risk for NAPD and BD. This finding contributes to our understanding of these disorders and has implications for the management of ASD.