This study investigated the dynamic changes in gut microbiota composition during pregnancy and its association with maternal lipid profiles and dyslipidemia. Analysis of fecal samples from 513 pregnant women revealed dynamic gut microbiome changes throughout pregnancy, with lower alpha diversity in dyslipidemic patients. Several genera (*Bacteroides, Paraprevotella, Alistipes, Christensenellaceae R7 group, Clostridia UCG-014, and UCG-002*) showed negative associations with lipid profiles and dyslipidemia. Metagenomic analysis identified pathways involved in gastrointestinal inflammation where disease-specific microbes played a role. Machine learning predicted dyslipidemia risk with an AUC of 0.824, combining microbiome and blood biochemical data. The gut microbiota, particularly *Alistipes* and *Bacteroides*, was linked to lipid profiles and dyslipidemia by affecting inflammatory pathways. Mid-pregnancy microbiome and blood data could predict late-pregnancy dyslipidemia risk, suggesting potential non-invasive diagnostic and therapeutic strategies.