Human gut dysbiosis is associated with type 2 diabetes mellitus (T2DM); however, the gut microbiome in pregnant women with pregestational type 2 diabetes mellitus (PGDM) remains unexplored. We investigated the alterations in the gut microbiota composition in pregnant women with or without PGDM. The gut microbiota was examined using 16S rRNA sequencing data of 234 maternal fecal samples that were collected during the first (T1), second (T2), and third (T3) trimesters. The PGDM group presented a reduction in the number of gut bacteria taxonomies as the pregnancies progressed. Linear discriminant analyses revealed that Megamonas, Bacteroides, and Roseburia intestinalis were enriched in the PGDM group, whereas Bacteroides vulgatus, Faecalibacterium prausnitzii, Eubacterium rectale, Bacteroides uniformis, Eubacterium eligens, Subdoligranulum, Bacteroides fragilis, Dialister, Lachnospiraceae, Christensenellaceae R-7, Roseburia inulinivorans, Streptococcus oralis, Prevotella melaninogenica, Neisseria perflava, Bacteroides ovatus, Bacteroides caccae, Veillonella dispar, and Haemophilus parainfluenzae were overrepresented in the control group. Correlation analyses showed that the PGDM-enriched taxa were correlated with higher blood glucose levels during pregnancy, whereas the taxonomic biomarkers of normoglycemic pregnancies exhibited negative correlations with glycemic traits. The microbial networks in the PGDM group comprised weaker microbial interactions than those in the control group. Our study reveals the distinct characteristics of the gut microbiota composition based on gestational ages between normoglycemic and PGDM pregnancies. Further longitudinal research involving women with T2DM at preconception stages and investigations using shotgun metagenomic sequencing should be performed to elucidate the relationships between specific bacterial functions and PGDM metabolic statuses during pregnancy and to identify potential therapeutic targets. IMPORTANCE The incidence of pregestational type 2 diabetes mellitus (PGDM) is increasing, with high rates of serious adverse maternal and neonatal outcomes that are strongly correlated with hyperglycemia. Recent studies have shown that type 2 diabetes mellitus is associated with gut microbial dysbiosis; however, the gut microbiome composition and its associations with the metabolic features of patients with PGDM remain largely unknown. In this study, we investigated the changes in the gut microbiota composition in pregnant women with and without PGDM. We identified differential taxa that may be correlated with maternal metabolic statuses during pregnancy. Additionally, we observed that the number of taxonomic and microbial networks of gut bacteria were distinctly reduced in women with hyperglycemia as their pregnancies progressed. These results extend our understanding of the associations between the gut microbial composition, PGDM-related metabolic changes, and pregnancy outcomes.