 This longitudinal study classified groups of children experiencing different trajectories of student-teacher relationship quality over the transition from preschool into school, and determined the strength of the association between different student-teacher relationship trajectories and childhood mental health problems in the second year of primary school.