Early development of the microbiome has been shown to affect general health and physical development of the infant and, although some studies have been undertaken in high-income countries, there are few studies from low- and middle-income countries. As part of the BARNARDS study, we examined the rectal microbiota of 2,931 neonates (term used up to 60 d) with clinical signs of sepsis and of 15,217 mothers screening for blaCTX-M-15, blaNDM, blaKPC and blaOXA-48-like genes, which were detected in 56.1%, 18.5%, 0% and 4.1% of neonates’ rectal swabs and 47.1%, 4.6%, 0% and 1.6% of mothers’ rectal swabs, respectively. Carbapenemase-positive bacteria were identified by MALDI-TOF MS and showed a high diversity of bacterial species (57 distinct species/genera) which exhibited resistance to most of the antibiotics tested. Escherichia coli, Klebsiella pneumoniae and Enterobacter cloacae/E. cloacae complex, the most commonly found isolates, were subjected to whole-genome sequencing analysis and revealed close relationships between isolates from different samples, suggesting transmission of bacteria between neonates, and between neonates and mothers. Associations between the carriage of antimicrobial resistance genes (ARGs) and healthcare/environmental factors were identified, and the presence of ARGs was a predictor of neonatal sepsis and adverse birth outcomes.