Background Late onset sepsis (LOS) in preterm infants is associated with considerable morbidity and mortality. While studies have implicated gut bacteria in the aetiology of the disease, functional analysis and mechanistic insights are generally lacking. We performed temporal bacterial (n = 613) and metabolomic (n = 63) profiling on extensively sampled stool from 7 infants with LOS and 28 matched healthy (no LOS or NEC) controls. Results The bacteria isolated in diagnostic blood culture usually corresponded to the dominant bacterial genera in the gut microbiome. Longitudinal changes were monitored based on preterm gut community types (PGCTs), where control infants had an increased number of PGCTs compared to LOS infants (P = 0.011). PGCT 6, characterised by Bifidobacteria dominance, was only present in control infants. Metabolite profiles differed between LOS and control infants at diagnosis and 7 days later, but not 7 days prior to diagnosis. Bifidobacteria was positively correlated with control metabolites, including raffinose, sucrose, and acetic acid. Conclusions Using multi-omic analysis, we show that the gut microbiome is involved in the pathogenesis of LOS. While the causative agent of LOS varies, it is usually abundant in the gut. Bifidobacteria dominance was associated with control infants, and the presence of this organism may directly protect, or act as a marker for protection, against gut epithelial translocation. While the metabolomic data is preliminary, the findings support that gut development and protection in preterm infants is associated with increased in prebiotic oligosaccharides (e.g. raffinose) and the growth of beneficial bacteria (e.g. Bifidobacterium).