Objective: Recent studies have suggested that autoimmune diseases and immune activation play a part in the pathogenesis of different neurodevelopmental disorders. This study investigated the association between a personal history and a family history of autoimmune disease and the risk of developing attention-deficit/hyperactivity disorder (ADHD). Method: A cohort was formed of all singletons born in Denmark from 1990 to 2007, resulting in a study population of 983,680 individuals followed from 1995 to 2012. Information on autoimmune diseases was obtained from the Danish National Hospital Register. Individuals with ADHD were identified through the Danish National Hospital Register and the Danish Psychiatric Central Register. Results: In total, 23,645 children were diagnosed with ADHD during the study period. Autoimmune disease in the individual was associated with an increased risk of ADHD by an incidence rate ratio of 1.24 (95% CI 1.10-1.40). The primary analyses associated maternal autoimmune disease with ADHD in the offspring (incidence rate ratio 1.12, 95% CI 1.06-1.19), whereas a paternal history of autoimmune diseases was not significantly associated with ADHD in the offspring. In exploratory analyses, an increased risk of ADHD was observed for children with a family history of thyrotoxicosis, type 1 diabetes, autoimmune hepatitis, psoriasis, and ankylosing spondylitis. Conclusion: A personal history and a maternal history of autoimmune disease were associated with an increased risk of ADHD. The previously reported association between type 1 diabetes and ADHD was confirmed. In addition, specific parental autoimmune diseases were associated with ADHD in offspring.