Breastfeeding acts to reduce pain for babies. One study concluded that breastfeeding effectively reduces babies' response to pain during minor invasive procedures.
Carbajal, R. et al. "Analgesic effect of breastfeeding in term neonates: Randomized controlled trial." BMJ 2003; 326:13. --- Gray, L. et al. "Breastfeeding is analgesic in healthy newborns." Pediatrics 2002; 109:590-93.