Following birth, newborn babies are rapidly colonized by microorganisms, and Shao et al. further corroborate that the mode of delivery is a crucial factor that shapes the gut microbiota during the neonatal period, with effects that persist into infancy. Metagenomic analysis of faecal samples from babies delivered vaginally were enriched with commensals (Bifidobacterium, Escherichia, Bacteroides and Parabacteroides species), whereas the gut microbiota of babies delivered by caesarean section were depleted of these commensal species and were dominated by opportunistic pathogens associated with the hospital environment (including Enterococcus, Enterobacter and Klebsiella species). Finally, large-scale culturing and whole-genome sequencing of opportunistic pathogens found in the faecal samples identified virulence factors and clinically relevant antimicrobial resistance genes, which suggests that opportunistic pathogen carriage is a risk factor for opportunistic infections.