BackgroundExisting literature indicates that Gestational diabetes mellitus (GDM) and maternal obesity disrupt the normal colonization of the neonatal gut microbiota alone. Still, the combined impact of GDM and excessive gestational weight gain (EGWG) on this process remains under explored. The association between gestational weight gain before/after GDM diagnosis and neonatal gut microbiota characteristics is also unclear.The purpose of this study is to conduct investigation and analysis on the above-mentioned issues, providing a basis for optimizing clinical management plans.MethodsThis study involved 98 mother-infant pairs categorized into GDM and non-GDM groups. The GDM group was further subdivided based on gestational weight gain (GWG) into normal (GDM+NGWG) and excessive (GDM+EGWG) weight gain groups. Neonatal stool samples were collected within 24 hours post-delivery for gut microbiota profiling through 16S rRNA gene sequencing. Statistical analyses explored correlations between total GWG/BMI gain and those before/after GDM diagnosis (t-GWG/GBG; b-GWG/GBG; a-GWG/GBG) with key bacterial taxa.ResultsNotable genus-level changes included enrichment of Escherichia and Klebsiella, and depletion of Bacteroides, Bifidobacterium, Coprococcus, Ruminococcus among GDM-Total and GDM+EGWG groups compared to non-GDM. Further,LEfSe analysis identified 30 differential bacteria taxa between GDM-Total and healthy control groups, which increased to 38 between GDM+EGWG and non-GDM groups, highlighting more pronounced microbial shifts associated with EGWG. Clostridium was negatively correlated with t-GWG and newborn birth weight; The Coriobacteriaceae showed a negative correlation with t-GWG, t-GBG, and a-GBG. Additionally,Collinsella exhibited negative correlations with t-GBG and a-GBG.ConclusionThis study has identified that the presence of EGWG in GDM mothers further exacerbated neonatal gut microbial perturbations. Total GWG/GBG and those after the diagnosis of GDM were negatively correlated with the abundance of neonatal gut Clostridium, Coriobacteriaceae, and Collinsella. These findings provide new insights for precise prevention and management of GDM.