Sex shaped the weekly patterns of preterm neonatal gut microbiome profiles during the first 4 weeks of the NICU hospitalization. Further clinical interventions should consider the distinct gut microbiota compositions and predicted functional profiles between female and male preterm neonates.