This study examined how social withdrawal as an individual factor and discrimination as a contextual factor contributed to depression caused by peer victimization among middle school students. Self-reported data of 1,611 students from 86 classrooms in 7 middle schools was analyzed, using multilevel path analysis. The results indicate that peer victimization had a significant partial mediating effect on the relation between social withdrawal and depression at the individual level. Social withdrawal had a direct positive effect on depression as well as an indirect positive effect on depression via high levels of peer victimization. Discrimination also positively predicted peer victimization at the classroom level. Moreover, classroom-level discrimination moderated the individual-level relations between social withdrawal and peer victimization. The relation between social withdrawal and peer victimization was much stronger as the levels of discrimination in the classroom were higher. These findings shed light on the importance of considering both individual and contextual factors when intervening to prevent peer victimization.