Necrotising enterocolitis (NEC) is a devastating intestinal disease primarily affecting preterm infants. The underlying mechanisms are poorly understood: mother's own breast milk (MOM) is protective, possibly relating to human milk oligosaccharide (HMO) and infant gut microbiome interplay. We investigated the interaction between HMO profiles and infant gut microbiome development and its association with NEC.We performed HMO profiling of MOM in a large cohort of infants with NEC (n=33) with matched controls (n=37). In a subset of 48 infants (14 with NEC), we also performed longitudinal metagenomic sequencing of infant stool (n=644).Concentration of a single HMO, disialyllacto-N-tetraose (DSLNT), was significantly lower in MOM received by infants with NEC compared with controls. A MOM threshold level of 241 nmol/mL had a sensitivity and specificity of 0.9 for NEC. Metagenomic sequencing before NEC onset showed significantly lower relative abundance of Bifidobacterium longum and higher relative abundance of Enterobacter cloacae in infants with NEC. Longitudinal development of the microbiome was also impacted by low MOM DSLNT associated with reduced transition into preterm gut community types dominated by Bifidobacterium spp and typically observed in older infants. Random forest analysis combining HMO and metagenome data before disease accurately classified 87.5% of infants as healthy or having NEC.These results demonstrate the importance of HMOs and gut microbiome in preterm infant health and disease. The findings offer potential targets for biomarker development, disease risk stratification and novel avenues for supplements that may prevent life-threatening disease.