BACKGROUND: Increased prevalence of mental illness has been reported in clinical studies of sex chromosome aneuploidies, but accurate population-based estimates of the prevalence and clinical detection rate of sex chromosome aneuploidies and the associated risks of psychiatric disorders are needed. In this study, we provide such estimates, valid for children and young adults of the contemporary Danish population. METHODS: We used the iPSYCH2015 case-cohort dataset, which is based on a source population of single-born individuals born in Denmark between May 1, 1981, and Dec 31, 2008. The case sample comprises all individuals from the source population with a diagnosis of any index psychiatric disorder (schizophrenia spectrum disorder, bipolar disorder, major depressive disorder, autism spectrum disorder, or ADHD) by the end of follow-up (Dec 31, 2015), registered in the hospital-based Danish Psychiatric Central Research Register. The cohort consists of individuals randomly selected from the source population, and overlaps with the case sample. Biobanked blood samples for individuals in the case and cohort samples underwent genotyping and quality-control filtering, after which we analysed microarray data to detect sex chromosome aneuploidy karyotypes (45,X, 47,XXX, 47,XXY, and 47,XYY). We estimated the population-valid prevalence of these karyotypes from the cohort sample. Weighted Cox proportional hazards models were used to estimate the risks of each index psychiatric disorder associated with each sex chromosome aneuploidy karyotype, by use of date of first hospitalisation with the index disorder in the respective case group and the cohort as outcome. The clinical detection rate was determined by comparing records of clinical diagnoses of genetic conditions from the Danish National Patient Register with sex chromosome aneuploidy karyotype determined by our study. FINDINGS: The assessed sample comprised 119 481 individuals (78 726 in the case sample and 43 326 in the cohort) who had genotyped and quality-control-filtered blood samples, including 64 533 (54%) people of gonadal male sex and 54 948 (46%) of gonadal female sex. Age during follow-up ranged from 0 to 34·7 years (mean 10·9 years [SD 3·5 years]). Information on ethnicity was not available. We identified 387 (0·3%) individuals as carriers of sex chromosome aneuploidies. The overall prevalence of sex chromosome aneuploidies was 1·5 per 1000 individuals. Each sex chromosome aneuploidy karyotype was associated with an increased risk of at least one index psychiatric disorder, with hazard ratios (HRs) of 2·20 (95% CI 1·42-3·39) for 47,XXY; 2·73 (1·25-6·00) for 47,XXX; 3·56 (1·01-12·53) for 45,X; and 4·30 (2·48-7·55) for 47,XYY. All karyotypes were associated with an increased risk of ADHD (HRs ranging from 1·99 [1·24-3·19] to 6·15 [1·63-23·19]), autism spectrum disorder (2·72 [1·72-4·32] to 8·45 [2·49-28·61]), and schizophrenia spectrum disorder (1·80 [1·15-2·80] to 4·60 [1·57-13·51]). Increased risk of major depressive disorder was found for individuals with 47,XXY (1·88 [1·07-3·33]) and 47,XYY (2·65 [1·12-5·90]), and of bipolar disorder for those with 47,XXX (4·32 [1·12-16·62]). The proportion of sex chromosome aneuploidy carriers who had been clinically diagnosed was 93% for 45,X, but lower for 47,XXY (22%), 47,XXX (15%), and 47,XYY (15%). Among carriers, the risk of diagnosis of at least one index psychiatric disorder did not significantly differ between those who had and had not been clinically diagnosed with sex chromosome aneuploidies (p=0·65). INTERPRETATION: Increased risks of psychiatric disorders associated with sex chromosome aneuploidies, combined with low rates of clinical diagnosis of sex chromosome aneuploidies, compromise the adequate provision of necessary health care and counselling to affected individuals and their families, which might be helped by increased application of genetic testing in clinical settings. FUNDING: Lundbeck Foundation and National Institutes of Health.