BackgroundSchool teachers are at heightened risk of mental health difficulties. A small number of trials have introduced teacher training to improve support for students, but none have increased support available for teachers themselves. We aimed to evaluate the effect of a mental health support and training intervention on secondary school teachers’ and students’ wellbeing and mental health. MethodsDrawing on social support theory and an ecological view of school connectedness, we developed an intervention that comprised training in Mental Health First Aid, a 1-h mental health awareness raising session, and a confidential staff peer support service. This cluster-randomised controlled trial tested intervention effectiveness compared with usual practice. Mainstream, non-fee paying, secondary schools in England and Wales, stratified by geographical area and free school meal entitlement (a proxy for student deprivation), were randomly allocated to intervention or control groups after collection of baseline measures. Participants and study team were aware of group assignment. We analysed data using mixed-effects repeated measures models in the intention-to-treat population, adjusted for stratification variables, sex, and years of experience (teacher outcomes only). A mixed-methods process evaluation was done. The primary outcome was teacher wellbeing (Warwick-Edinburgh Mental Wellbeing Scale). Secondary outcomes were teacher depression, absence, and presenteeism, and student wellbeing, mental health difficulties, attendance, and attainment. Follow-up was done at months 12 and 24. This trial is registered with ISRCTN, number 95909211. FindingsBetween March 24 and June 30, 2016, 25 schools (12 intervention, 13 control) were recruited; cluster sizes were 40–119 teachers. 1722 teachers were included in the primary analysis. Teacher wellbeing did not differ between groups (adjusted mean difference −0·90, 95% CI −2·07 to 0·27; intracluster correlation coefficient 0·01), nor did any of the secondary outcomes (adjusted p=0·203–0·964). Participant checklists showed good fidelity to training content (mean score 4·7/5 [SD 0·6]), and peer support reports indicated good adherence to service delivery guidelines. Teacher focus group data showed good initial acceptability, but usage of the peer support service waned over 2 years. Participants reported that the intervention had little impact on school culture and lacked genuine buy-in from senior leaders. InterpretationThe intervention did not achieve population-level improvement to teacher or student mental health, possibly due to a failure to instigate sustained, school-level cultural change. Future research should focus on how to create systemic change in schools to improve the effectiveness of interventions. FundingNational Institute for Health Research Public Health Research programme, Public Health Wales, Public Health England, and Bristol City Council.