This quasi-experimental study estimates academic peer effects in China's middle school (7th–9th grade) classrooms, using data from a large-scale nationally representative survey of middle schoolers in China. Our study design circumvents endogenous sorting by focusing on 52 schools that randomly assigned incoming 7th graders to different 7th-grade classes. Further, reverse causality is addressed by regressing students' 8th-grade test scores on their (randomly assigned) classmates' average 7th-grade test scores. Our analysis reals that all else equal, a one-standard-deviation increase in (8th-grade) classmates' average 7th-grade test scores raises an individual student's 8th-grade mathematics and English test scores, respectively, by 0.13–0.18 and 0.11–0.17 standard deviations. These estimates remain stable when peer characteristics examined in related peer-effect studies are included in the model. Further analysis reveals that peer effects work through raising individual students' time spent studying per week and their confidence in learning. Finally, classroom peer effects are found to be heterogeneous across subgroups: larger for boys, academically stronger students, students attending better schools (i.e., schools with smaller classes and urban schools), and students with relatively disadvantaged family backgrounds (e.g., lower levels of parental education and family wealth).