Teachers’ relationship quality with students has been argued to be an important source of teacher wellbeing. Thus, the current study aimed to investigate to what extent teachers’ relationship closeness toward students, combined with attachment security is a resource protecting against teacher burnout. Eighty-three elementary school teachers reported on their most and least attached student’s relationship closeness, their attachment security and levels of burnout, as measured by emotional exhaustion, depersonalization and personal accomplishment. Response surface analysis (RSA), enabling researchers to investigate the effect of congruence/incongruence of two predictors on an outcome, revealed that teachers’ depersonalization and emotional exhaustion were lowest when they developed homogenous close relationships toward the students within their classroom and when teachers in general made congruent relationship experiences. No RSA model could be specified for personal accomplishment, even though a correlational analysis revealed that increasing closeness with students fostered teachers’ personal accomplishment. Teachers’ secure attachment experiences were not directly related to burnout, but enhanced their capability to establish close relationships toward their students. Findings suggest that teachers’ relationships toward students are a resource for the teacher’s wellbeing, which highlights once again the importance of student–teacher relationships in education.