We tested whether a brief self-affirmation writing intervention protected against identity-threats (i.e., stereotyping and discrimination) for adolescents’ school-related adjustment. The longitudinal study followed 639 adolescents in Germany (65% of immigrant descent, 50% female, Mage = 12.35 years, SDage = .69) from 7th grade (pre-intervention at T1, five to six months post-intervention at T2) to the end of 8th grade (one-year follow-up at T3). We tested for direct and moderated (by heritage group, discrimination, classroom cultural diversity climate) effects using regression and latent change models. The self-affirmation intervention did not promote grades or math competence. However, in the short-term and for adolescents of immigrant descent, the intervention prevented a downward trajectory in mastery reactions to academic challenges for those experiencing greater discrimination. Further, it protected against a decline in behavioral school engagement for those in positive classroom cultural diversity climates. In the long-term and for all adolescents, the intervention lessened an upward trajectory in disruptive behavior. Overall, the self-affirmation intervention benefited some aspects of school-related adjustment for adolescents of immigrant and non-immigrant descent. The intervention context is important, with classroom cultural diversity climate acting as a psychological affordance enhancing affirmation effects. Our study supports the ongoing call for theorizing and empirically testing student and context heterogeneity to better understand for whom and under which conditions this intervention may work.