With the exception of iodine and Fe, there is still very limited information on the effect of micronutrients on cognitive function, especially among school-age children. The present analysis evaluates the relationship between dietary Fe, Zn and B vitamins (B12, B6, folate and riboflavin) and gains in cognitive test scores among school children in rural Kenya. Data for the present study were obtained from The Child Nutrition Kenya Project, a 2-year longitudinal, randomised controlled feeding intervention study using animal source foods. Dietary nutrient values were based on monthly and bimonthly 24 h recall data collected during the study period. In longitudinal regression analyses, available Fe, available Zn, vitamin B12 and riboflavin showed significant relationships with improved cognitive test scores, after controlling for confounders such as energy intake, school, socio-economic status and morbidity. Available Fe intake was associated with significantly higher gains in Raven's Coloured Progressive Matrices test scores over time. Available Zn intake was associated with significantly higher gains in digit span-total test scores over time, while vitamin B12 and riboflavin intakes were each associated with significantly higher gains in digit span-forward test scores over time. This analysis demonstrates the influence of improved dietary micronutrient status on school children's cognitive function.