This study analyzes the relationships of adolescents' perceptions of their family and classroom environments with peer relational victimization, taking into account that these relationships could be mediated by adolescents' self-esteem, feelings of loneliness, and sociometric status. These relationships, and their possible gender differences, were analyzed in a sample of 1319 Spanish adolescents (48% boys and 52% girls), ages 11 to 16 years (M = 13.7, SD = 1.5). A structural equation modeling was calculated for boys and girls separately. The findings suggested that the adolescents' self-esteem, loneliness, and sociometric status had a significant direct effect on peer relational victimization for boys, and adolescents' loneliness and sociometric status for girls. Their perceptions of family and classroom environments had a significant indirect effect on peer relational victimization for boys and girls, but the paths were different. Overall, findings suggested that a negative classroom environment had a more relevant effect in relational victimization for boys.