Human milk decreases the risk of necrotising enterocolitis (NEC), a severe gastrointestinal disease that occurs in 5–10 % of preterm infants. The prebiotic and immune-modulatory effects of milk oligosaccharides may contribute to this protection. Preterm pigs were used to test whether infant formula enriched with α1,2-fucosyllactose (2'-FL, the most abundant oligosaccharide in human milk) would benefit gut microbial colonisation and NEC resistance after preterm birth. Caesarean-delivered preterm pigs were fed formula (Controls, n 17) or formula with 5 g/l 2'-FL (2'-FL, n 16) for 5 d; eight 2'-FL pigs (50 %) and twelve Controls (71 %) developed NEC, with no difference in lesion scores (P=0·35); 2'-FL pigs tended to have less anaerobic bacteria in caecal contents (P=0·22), but no difference in gut microbiota between groups were observed by fluorescence in situ hybridisation and 454 pyrosequencing. Abundant α1,2-fucose was detected in the intestine with no difference between groups, and intestinal structure (villus height, permeability) and digestive function (hexose absorption, brush border enzyme activities) were not affected by 2'-FL. Formula enrichment with 2'-FL does not affect gut microbiology, digestive function or NEC sensitivity in pigs within the first few days after preterm birth. Milk 2'-FL may not be critical in the immediate postnatal period of preterm neonates when gut colonisation and intestinal immunity are still immature.