Inflammatory bowel disease (IBD) has been associated with psychiatric morbidity in adults, although previous studies have not accounted for familial confounding. In children, IBD has an even more severe course, but the association between childhood-onset IBD and psychiatric morbidity remains unclear. To examine the risk of psychiatric morbidity in individuals with childhood-onset IBD, controlling for potential confounding shared between siblings. A population-based cohort study was conducted using data from the Swedish national health care and population registers of all children younger than 18 years born from 1973 to 2013. The study included 6464 individuals with a diagnosis of childhood-onset IBD (3228 with ulcerative colitis, 2536 with Crohn disease, and 700 with IBD unclassified) who were compared with 323 200 matched reference individuals from the general population and 6999 siblings of patients with IBD. Cox proportional hazards regression was used to estimate hazard ratios (HRs) with 95% CIs. Statistical analysis was performed from January 1, 1973, to December 1, 2013. The primary outcome was any psychiatric disorder and suicide attempt. Secondary outcomes were the following specific psychiatric disorders: psychotic, mood, anxiety, eating, personality, and behavioral disorders; substance misuse; attention-deficit/hyperactivity disorder; autism spectrum disorders; and intellectual disability. The study included 6464 individuals with a diagnosis of childhood-onset IBD (2831 girls and 3633 boys; mean [SD] age at diagnosis of IBD, 13  years). During a median follow-up time of 9 years, 1117 individuals with IBD (17.3%) received a diagnosis of any psychiatric disorder (incidence rate, 17.1 per 1000 person-years), compared with 38 044 of 323 200 individuals (11.8%) in the general population (incidence rate, 11.2 per 1000 person-years), corresponding to an HR of 1.6 (95% CI, 1.5-1.7), equaling 1 extra case of any psychiatric disorder per 170 person-years. Inflammatory bowel disease was significantly associated with suicide attempt (HR, 1.4; 95% CI, 1.2-1.7) as well as mood disorders (HR, 1.6; 95% CI, 1.4-1.7), anxiety disorders (HR, 1.9; 95% CI, 1.7-2.0) eating disorders (HR, 1.6; 95% CI, 1.3-2.0), personality disorders (HR, 1.4; 95% CI, 1.1-1.8), attention-deficit/hyperactivity disorder (HR, 1.2; 95% CI, 1.1-1.4), and autism spectrum disorders (HR, 1.4; 95% CI, 1.1-1.7) Results were similar for boys and girls. Hazard ratios for any psychiatric disorder were highest in the first year of follow-up but remained statistically significant after more than 5 years. Psychiatric disorders were particularly common for patients with very early-onset IBD (<6 years) and for patients with a parental psychiatric history. Results were largely confirmed by sibling comparison, with similar estimates noted for any psychiatric disorder (HR, 1.6; 95% CI, 1.5-1.8) and suicide attempt (HR, 1.7; 95% CI, 1.2-2.3). Overall, childhood-onset IBD was associated with psychiatric morbidity, confirmed by between-sibling results. Particularly concerning is the increased risk of suicide attempt, suggesting that long-term psychological support be considered for patients with childhood-onset IBD.