Stronger social and emotional well-being during primary school is positively associated with the health and educational outcomes of young people. However, there is little evidence on which programmes are the most effective for improving social and emotional well-being. The objective was to rigorously evaluate the Social and Emotional Education and Development (SEED) intervention process for improving pupils' social and emotional well-being. This was a stratified cluster randomised controlled trial with embedded process and economic evaluations. Thirty-eight primary schools were randomly assigned to the SEED intervention or to the control group. Hierarchical regression analysis allowing for clustering at school learning community level was conducted in R (statistical package). The SEED intervention is a whole-school intervention; it involved all school staff and two cohorts of pupils, one starting at 4 or 5 years of age and the second starting at 8 or 9 years of age, across all 38 schools. A total of 2639 pupils in Scotland. The SEED intervention used an iterative process that involved three components to facilitate selection and implementation of school-based actions: (1) questionnaire completion, (2) benchmarked feedback to all staff and (3) reflective discussions (all staff and an educational psychologist). The primary outcome was pupils' Strengths and Difficulties Questionnaire-Total Difficulties Score when pupils were 4 years older than at baseline. The primary outcome, pupils' Strengths and Difficulties Questionnaire-Total Difficulties Score at follow-up 3, showed improvements for intervention arm pupils, compared with those in the control arm [relative risk -1.30 (95% confidence interval -1.87 to -0.73), standardised effect size -0.27 (95% confidence interval -0.39 to -0.15)]. There was no evidence of intervention effects according to deprivation: the results were significant for both affluent and deprived pupils. Subgroup analysis showed that all effect sizes were larger for the older cohort, particularly boys [relative risk -2.36 (95% confidence interval -3.62 to -1.11), standardised effect size -0.42 (95% confidence interval -0.64 to -0.20)]. Although there was no statistically significant difference in incremental cost and quality-adjusted life-years, the probability that the intervention is cost-effective at a willingness-to-pay threshold of £20,000 per quality-adjusted life-year was high, at 88%. Particularly valued mechanisms of the SEED intervention were its provision of time to reflect on and discuss social and emotional well-being and its contribution to a culture of evaluating practice. It was a challenge to retain schools over five waves of data collection. This trial demonstrated that the SEED intervention is an acceptable, cost-effective way to modestly improve pupil well-being and improve school climate, particularly for older boys and those with greater levels of psychological difficulties. It was beneficial during the transition from primary to secondary school, but this diminished after 6 years. The SEED intervention can be implemented alongside existing systems for addressing pupil well-being and can be complementary to other interventions. Assess whether or not the SEED intervention has a beneficial impact on academic attainment, is transferable to other countries and other organisational settings, would be strengthened by adding core training elements to the intervention process and is transferable to secondary schools. Understand the gender differences illustrated by the outcomes of this trial. Conduct further statistical research on how to handle missing data in longitudinal studies of complex social interventions. This trial is registered as ISRCTN51707384. This award was funded by the National Institute for Health and Care Research (NIHR) Public Health Research programme (NIHR award ref: 10/3006/13) and is published in full in Public Health Research; Vol. 12, No. 6. See the NIHR Funding and Awards website for further award information.