ImportanceRobust longitudinal studies of within-child changes in mental health associated with the COVID-19 pandemic are lacking, as are studies examining sources of heterogeneity in such changes.ObjectiveTo investigate within-child changes, overall and between subgroups, in youth mental health from prepandemic to midpandemic.Design, Setting, and ParticipantsThis cohort study used longitudinal prepandemic and midpandemic data from the Environmental influences on Child Health Outcomes (ECHO) Program, collected between January 1, 2015, and March 12, 2020 (prepandemic), and between March 13, 2020, and August 31, 2022 (midpandemic). Data were analyzed between December 1, 2022, and June 1, 2024. The sample included 9 US-based observational longitudinal pediatric ECHO cohorts. Cohorts were included if they collected the Child Behavior Checklist (CBCL) School Age version before and during the pandemic on more than 20 participants of normal birth weight aged 6 to 17 years.ExposureThe COVID-19 pandemic.Main Outcomes and MeasuresPrepandemic to midpandemic changes in CBCL internalizing, externalizing, depression, anxiety, and attention-deficit/hyperactivity disorder (ADHD) scores were estimated, and differences in outcome trajectories by child sociodemographic characteristics (age, sex, race, ethnicity, and poverty level) and prepandemic mental health problems were examined using established CBCL clinical score thresholds.ResultsA total of 1229 participants (mean [SD] age during the pandemic, 10.68 [2.29] years; 625 girls [50.9%]) were included. The sample was socioeconomically diverse (197 of 1056 children [18.7%] lived at ≤130% of the Federal Poverty Level; 635 (51.7%) identified as White, 388 (31.6%) as Black, 147 (12.0%) as multiracial, 40 (3.3%) as another race, and 118 (9.6%) as Hispanic). Generalized linear mixed-effects models revealed minor decreases in externalizing problems (β = −0.88; 95% CI, −1.16 to −0.60), anxiety (β = −0.18; 95% CI, −0.31 to −0.05), and ADHD (β = −0.36; 95% CI, −0.50 to −0.22), but a minor increase in depression (β = 0.22; 95% CI, 0.10 to 0.35). Youth with borderline or clinically meaningful prepandemic scores experienced decreases across all outcomes, particularly externalizing problems (borderline, β = −2.85; 95% CI, −3.92 to −1.78; clinical, β = −4.88; 95% CI, −5.84 to −3.92). Low-income (β = −0.76; 95% CI, −1.14 to −0.37) and Black (β = −0.52; 95% CI, −0.83 to −0.20) youth experienced small decreases in ADHD compared with higher income and White youth, respectively.Conclusions and RelevanceIn this longitudinal cohort study of economically and racially diverse US youth, there was evidence of differential susceptibility and resilience for mental health problems during the pandemic that was associated with prepandemic mental health and sociodemographic characteristics.