INTRODUCTION: The aim of this study was to examine the relationship between duration of breastfeeding and educational outcomes. We hypothesized that longer periods of breastfeeding would predict better educational outcomes in middle childhood. METHODS: The Western Australian Pregnancy Cohort (Raine) Study used a cohort of 2900 women who were enrolled at 18 weeks' gestation; with 2868 live-born children were followed prospectively. At ∼10 years of age, data from 1038 children were linked to standardized mathematics, reading, writing, and spelling scores. Associations between breastfeeding duration and educational outcomes were estimated by using linear models with adjustment for gender, family income, maternal factors, and early stimulation at home through reading. RESULTS: Ten-year-old children who were predominantly breastfed for 6 months or longer in infancy had higher academic scores than children who were breastfed for less than 6 months. The effect of breastfeeding on educational outcomes differed according to gender; boys were particularly responsive (in mathematics, spelling, reading, and writing) to a longer duration of breastfeeding. CONCLUSIONS: Predominant breastfeeding for 6 months or longer was positively associated with academic achievement in children at 10 years of age. However, the effectiveness of breastfeeding differed according to gender; the benefits were only evident for boys.