Students in Brazil are typically assigned to classes based on the age ranking in their cohort. I exploit this rule to estimate the effects on maths achievement of being in class with older peers for students in fifth grade. I find that being assigned to the older class leads to a drop in Math 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.