This paper represents the first application of a novel strategy to estimate peer effects in education in a developing country. It provides evidence on peer effects in standardized tests by exploiting a unique data set on social networks in Uruguayan primary schools. The identification method enables one to solve the reflection problem via instrumental variables that emerge naturally from the network structure. Correlated effects are controlled for via classroom fixed effects. I find significant endogenous effects in reading, math scores (and mixed evidence on science): a one-standard deviation increase in peers' scores increases own scores by about 40 percent of a standard deviation. Simulation exercises show that, in a context of socioeconomic segregation in which students are assigned to public schools according to their neighborhood of residence, peer effects may amplify educational inequalities.