Abstract
Students in Brazil are typically assigned to classes based on the age ranking in their cohort. I exploit this rule to estimate how fifth-grade students' achievement in mathematics is affected when they are in classes with older peers. I find that being assigned to the older class leads to a drop in maths scores of about 0.4 of a standard deviation for students at the cut-off. I provide evidence that heterogeneity in age is an important factor behind this effect. Information on teaching practices and student behaviour sheds light on how class heterogeneity harms learning.