ImportanceAs young people’s mental health difficulties increase, understanding risk and resilience factors under challenging circumstances becomes critical.ObjectiveTo explore the outcomes of the COVID-19 pandemic on secondary school students’ mental health difficulties, as well as the associations with individual, family, friendship, and school characteristics.Design, Setting, and ParticipantsFor this cohort study, follow-up data from the My Resilience in Adolescence (MYRIAD) cluster randomized clinical trial were collected across 2 representative UK cohorts. Mainstream UK secondary schools with a strategy and structure to deliver social-emotional learning, with an appointed head teacher, and that were not rated “inadequate” in their latest official inspection were recruited. A total of 5663 schools were approached, 532 showed interest, and 84 consented. Cohort 1 included 12 schools and 864 students, and cohort 2 included 72 schools and 6386 students. COVID-19 was declared a pandemic after cohort 1 had completed all assessments (September 2018 to January 2020), but cohort 2 had not (September 2019 to June 2021).ExposuresCohort 2 was exposed to the COVID-19 pandemic, including 3 national lockdowns. Associations of individual, family, friendship, and school characteristics with students’ mental health were explored.Main Outcomes and MeasuresChanges in students’ risk for depression (Center for Epidemiological Studies-Depression scale); social, emotional, and behavioral difficulties (Strengths and Difficulties Questionnaire); and mental well-being (Warwick-Edinburgh Mental Well-Being Scale).ResultsOf the 7250 participants included, the mean (SD) age was 13.7 (0.6) years, 3947 (55.4%) identified as female, and 5378 (73.1%) self-reported their race as White. Twelve schools and 769 of the 864 students (89.0%) in cohort 1 and 54 schools and 2958 of the 6386 students (46.3%) in cohort 2 provided data and were analyzed. Mental health difficulties increased in both cohorts but to a greater extent among students exposed to the pandemic, including for risk of depression (adjusted mean difference [AMD], 1.91; 95% CI, 1.07-2.76); social, emotional, and behavioral difficulties (AMD, 0.76; 95% CI, 0.33-1.18); and mental well-being (AMD, −2.08; 95% CI, −2.80 to −1.36). Positive school climate, high home connectedness, and having a friend during lockdown were protective factors during the pandemic. Female gender and initial low risk for mental health difficulties were associated with greater mental health deteriorations. Partial school attendance during lockdown was associated with better adjustment than no attendance when returning to school.Conclusions and RelevanceThis cohort study of secondary school students demonstrated that to promote mental health and adjustment, policy interventions should foster home connectedness, peer friendship, and school climate; avoid full school closures; and consider individual differences.