While studies investigating the health effects of racial discrimination for children and youth have examined a range of effect modifiers, to date, relationships between experiences of racial discrimination, student attitudes, and health outcomes remain unexplored. This study uniquely demonstrates the moderating effects of vicarious racism and motivated fairness on the association between direct experiences of racism and mental health outcomes, specifically depressive symptoms and loneliness, among primary and secondary school students. Across seven schools, 263 students (54.4% female), ranging from 8 to 17 years old (M = 11.2, SD = 2.2) reported attitudes about other racial/ethnic groups and experiences of racism. Students from minority ethnic groups (determined by country of birth) reported higher levels of loneliness and more racist experiences relative to the majority group students. Students from the majority racial/ethnic group reported higher levels of loneliness and depressive symptoms if they had more friends from different racial/ethnic groups, whereas the number of friends from different groups had no effect on minority students' loneliness or depressive symptoms. Direct experiences of racism were robustly related to higher loneliness and depressive symptoms in multivariate regression models. However, the association with depressive symptoms was reduced to marginal significance when students reported low motivated fairness. Elaborating on the negative health effects of racism in primary and secondary school students provides an impetus for future research and the development of appropriate interventions.