In Peru, indigenous children obtain lower scores on academic tests, on average, than non-indigenous children. In this study, we investigate whether a test score achievement gap is found by the age of 5 and whether this gap increases by the age of 8. While the literature has focused on the underlying family and children determinants of achievement gaps, we use an extension of the Oaxaca-Blinder technique to include community sorting effects and heterogeneity in community impact effects. Using the 2001 cohort of the Young Lives longitudinal survey for Peru, our results show that at the age of 5, indigenous children are far behind their non-indigenous counterparts in Spanish vocabulary (as measured by the PPVT), but less far behind in maths. Over the first three years of school, however, indigenous children lose substantial ground relative to non-indigenous children, increasing the average gap to 0.49 standard deviations (of the distribution of test scores) in maths and 0.66 in vocabulary. Our results suggest not only that parental education and a child's health are important determinants of the gap for maths and vocabulary, as previously found in the literature; but also that the vocabulary gap is due in part to community effects. The pathways considered yield valuable information for policymakers who are interested in developing policies to improve student learning among indigenous groups. These pathways are important for human capital formation and could potentially have long-term impacts on educational attainment and poverty in Peru.