While special educational needs (SEN) are increasingly recorded among schoolchildren, infant breastfeeding has been associated with reduced incidence of childhood physical and mental health problems. This study investigated relationships between infant feeding method and risk of all-cause and cause-specific SEN. A population cohort of schoolchildren in Scotland was constructed by linking together health (maternity, birth, and health visitor records) and education (annual school pupil census) databases. Inclusion was restricted to singleton children, born in Scotland from 2004 onwards with available breastfeeding data and who attended local authority mainstream or special schools between 2009 and 2013. Generalised estimating equation models with a binomial distribution and logit link function investigated associations between infant feeding method at 6 to 8 weeks and all-cause and cause-specific SEN, adjusting for sociodemographic and maternity factors. Of 191,745 children meeting inclusion criteria, 126,907 (66.2%) were formula-fed, 48,473 (25.3%) exclusively breastfed, and 16,365 (8.5%) mixed-fed. Overall, 23,141 (12.1%) children required SEN. Compared with formula feeding, mixed feeding and exclusive breastfeeding, respectively, were associated with decreased all-cause SEN (OR 0.90, 95% CI [0.84,0.95], p < 0.001 and 0.78, [0.75,0.82], p < 0.001), and SEN attributed to learning disabilities (0.75, [0.65,0.87], p < 0.001 and 0.66, [0.59,0.74], p < 0.001), and learning difficulties (0.85, [0.77,0.94], p = 0.001 and 0.75, [0.70,0.81], p < 0.001). Compared with formula feeding, exclusively breastfed children had less communication problems (0.81, [0.74,0.88], p = 0.001), social-emotional-behavioural difficulties (0.77, [0.70,0.84], p = 0.001), sensory impairments (0.79, [0.65,0.95], p = 0.01), physical motor disabilities (0.78, [0.66,0.91], p = 0.002), and physical health conditions (0.74, [0.63,0.87], p = 0.01). There were no significant associations for mixed-fed children (communication problems (0.94, [0.83,1.06], p = 0.312), social-emotional-behavioural difficulties (0.96, [0.85,1.09], p = 0.541), sensory impairments (1.07, [0.84,1.37], p = 0.579), physical motor disabilities (0.97, [0.78,1.19], p = 0.754), and physical health conditions (0.93, [0.74,1.16], p = 0.504)). Feeding method was not significantly associated with mental health conditions (exclusive 0.58 [0.33,1.03], p = 0.061 and mixed 0.74 [0.36,1.53], p = 0.421) or autism (exclusive 0.88 [0.77,1.01], p = 0.074 and mixed 1.01 [0.84,1.22], p = 0.903). Our study was limited since only 6- to 8-week feeding method was available precluding differentiation between never-breastfed infants and those who stopped breastfeeding before 6 weeks. Additionally, we had no data on maternal and paternal factors such as education level, IQ, employment status, race/ethnicity, or mental and physical health. In this study, we observed that both breastfeeding and mixed feeding at 6 to 8 weeks were associated with lower risk of all-cause SEN, and SEN attributed to learning disabilities and learning difficulty. Many women struggle to exclusively breastfeed for the full 6 months recommended by WHO; however, this study provides evidence that a shorter duration of nonexclusive breastfeeding could nonetheless be beneficial with regard to the development of SEN. Our findings augment the existing evidence base concerning the advantages of breastfeeding and reinforce the importance of breastfeeding education and support.