Background Health and Safety Executive data show that teachers are at heightened risk of mental health difficulties, yet few studies have attempted to address this. Poor teacher mental health may impact on the quality of support provided to young people, who also report increased mental health difficulties themselves. Objective To test the effectiveness of an intervention aiming to improve secondary school teachers’ well-being through mental health support and training. Design A cluster randomised controlled trial with embedded process and economic evaluations. Setting Twenty-five mainstream, non-fee-paying secondary schools in the south-west of England and South Wales, stratified by geographical area and free school meal entitlement, randomly allocated to intervention or control groups following collection of baseline measures (n = 12, intervention; n = 13, control) between May and July 2016. Participants All teachers in the study schools at any data collection. All students in year 8 (baseline) and year 10 (final follow-up). Intervention Each intervention school received three elements: (1) a 1-day mental health first aid for schools and colleges training session delivered to 8% of all teachers; (2) a 1-hour mental health session delivered to all teachers; and (3) 8% of staff trained in the 2-day standard mental health first aid training course set up a confidential peer support service for colleagues. Control schools continued with usual practice. Main outcome measures The primary outcome was teacher well-being (using the Warwick–Edinburgh Mental Wellbeing Scale). Secondary outcomes were teacher depression, absence and presenteeism, and student well-being, mental health difficulties, attendance and attainment. Follow-up was at 12 and 24 months. Data were analysed using intention-to-treat mixed-effects repeated-measures models. Economic evaluation A cost–consequence analysis to compare the incremental cost of the intervention against the outcomes measured in the main analysis. Process evaluation A mixed-methods study (i.e. qualitative focus groups and interviews, quantitative surveys, checklists and logs) to examine intervention implementation, activation of the mechanisms of change outlined in the logic model, intervention acceptability and the wider context. Results All 25 schools remained in the study. A total of 1722 teachers were included in the primary analysis. We found no difference in mean teacher well-being between study arms over the course of follow-up (adjusted mean difference –0.90, 95% confidence interval –2.07 to 0.27). There was also no difference in any of the secondary outcomes (p-values 0.203–0.964 in the fully adjusted models). The average cost of the intervention was £9103 (range £5378.97–12,026.73) per intervention school, with the average cost to Welsh schools being higher because of a different delivery model. The training components were delivered with high fidelity, although target dosage was sometimes missed. The peer support service was delivered with variable fidelity, and reported usage by teachers was low (5.9–6.1%). The intervention had high acceptability, but participants reported low support from senior leadership, and minimal impact on school culture. Limitations Participants and the study team were unblinded, self-report for the main outcome measures and inaccurate measurement of peer support service usage. Conclusions The Wellbeing in Secondary Education (WISE) intervention was not effective at improving teacher or student well-being, or reducing mental health difficulties, possibly because of contextual barriers preventing it becoming embedded in school life. Future work Identification of ways in which to achieve system-level change and sustained support from senior leaders is important for future school-based mental health interventions. Trial registration Current Controlled Trials ISRCTN95909211. Funding This project was funded by the National Institute for Health Research Public Health Research programme and will be published in full in Public Health Research; Vol. 9, No. 12. See the NIHR Journals Library website for further project information. Intervention costs were met by Public Health Wales, Public Health England and Bristol City Council.