To evaluate the association between neonatal bronchopulmonary dysplasia and the subsequent development of mental health conditions in children and adolescents. This was a retrospective cohort study, utilizing data from individuals born in South Korea between 2002 and 2005 and followed up until 2021, using the National Health Insurance Database. The cohort included 1,893,314 participants born during that period, with 927 diagnosed with bronchopulmonary dysplasia during the neonatal period (the exposed cohort). They were matched 1:10 with 9,270 unexposed individuals (the unexposed cohort) based on key demographic factors. The median age at the first mental health disorder diagnosis was 9 years (interquartile range, 5-15 years), with 5,698 individuals (55.9%) being male. During an average follow-up of 15.2 years, the incidence rate was 481/10,000 person-years in the exposed and 138/10,000 person-years in the unexposed cohort. By the age of 18 years, the cumulative incidence in the exposed cohort was 54% (95% confidence interval [CI]; 50%-57%), with an adjusted hazard ratio of 3.18 (95% CI; 2.81-3.60) compared with the unexposed cohort, and adjusted hazard ratios for early- and late-onset mental health disorders of 4.48 (95% CI; 3.84-5.22) and 1.89 (95% CI; 1.61-2.22), respectively. Sensitivity analyses confirmed these findings, and a subgroup analysis revealed a higher risk among individuals with bronchopulmonary dysplasia who required prolonged respiratory support or oxygen. Half of children with bronchopulmonary dysplasia in our cohort developed mental health disorders by the age of 18 years, emphasizing the need for interventions and support for such individuals.