Autism spectrum disorders (ASD) and attention-deficit/hyperactivity disorder (ADHD) frequently co-occur. The presence of a genetic link between ASD and ADHD symptoms is supported by twin studies, but the genetic overlap between clinically ascertained ASD and ADHD remains largely unclear. We therefore investigated how ASD and ADHD co-aggregate in individuals and in families to test for the presence of a shared genetic liability and examined potential differences between low- and high-functioning ASD in the link with ADHD. We studied 1 899 654 individuals born in Sweden between 1987 and 2006. Logistic regression was used to estimate the association between clinically ascertained ASD and ADHD in individuals and in families. Stratified estimates were obtained for ASD with (low-functioning) and without (high-functioning) intellectual disability. Individuals with ASD were at higher risk of having ADHD compared with individuals who did not have ASD (odds ratio (OR)=22.33, 95% confidence interval (CI): 21.77-22.92). The association was stronger for high-functioning than for low-functioning ASD. Relatives of individuals with ASD were at higher risk of ADHD compared with relatives of individuals without ASD. The association was stronger in monozygotic twins (OR=17.77, 95% CI: 9.80-32.22) than in dizygotic twins (OR=4.33, 95% CI: 3.21-5.85) and full siblings (OR=4.59, 95% CI: 4.39-4.80). Individuals with ASD and their relatives are at increased risk of ADHD. The pattern of association across different types of relatives supports the existence of genetic overlap between clinically ascertained ASD and ADHD, suggesting that genomic studies might have underestimated this overlap.