BackgroundSchool closures and social distancing may have affected mental health among preadolescent and adolescent children, who are in a social developmental stage. Rates of anxiety, depression, and stress have been reported to have increased during the COVID-19 pandemic among teenagers worldwide. However, most studies have measured children's mental health in cross-sectional studies or short-term comparisons before and after lockdowns and school closures, and few studies have tracked the long-term effects on mental health among children and adolescents, despite the pandemic lasting more than 2 years.MethodsAn interrupted time-series analysis was performed for longitudinal changes in the monthly number of new mental disorders (eating disorders, schizophrenia, mood disorders, and somatoform disorders). Using a nationwide multicenter electronic health records database in Japan, we analyzed data of patients aged 9 to 18 years from 45 facilities that provided complete data throughout the study period. The study period covered January 2017 to May 2021, defining a national school closure as an intervention event. We modeled the monthly new diagnoses of each mental disorder using a segmented Poisson regression model.ResultsThe number of new diagnoses throughout the study period was 362 for eating disorders, 1104 for schizophrenia, 926 for mood disorders, and 1836 for somatoform disorders. The slope of the regression line in monthly number of new diagnoses increased in the post-pandemic period for all targeted mental disorders (change in slope for eating disorders 1.05, 95% confidence interval [CI] 1.00–1.11; schizophrenia 1.04, 95% CI 1.01–1.07; mood disorders 1.04, 95% CI 1.01–1.07; and somatoform disorders 1.04 95% CI 1.02–1.07). The number of new diagnoses for schizophrenia and mood disorders increased early after school closure; while eating disorders showed an increasing trend several months later. Somatoform disorders showed a decreasing trend followed by an increasing trend. Time trends by sex and age also differed for each mental disorder.ConclusionsIn the post-pandemic period, the number of new cases increased over time for eating disorders, schizophrenia, mood disorders, and somatoform disorders. The timing of increase and trends by sex and age differed for each mental disorder.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12889-023-16228-z.