BackgroudBile acid metabolism is reported to be closely involved in glycolipid metabolism. We investigated the association of the total bile acid (TBA) levels at the second trimester with the risk of gestational diabetes mellitus (GDM) and adverse perinatal outcomes.MethodsWe performed a retrospective cohort study in 2773 Chinese pregnant women. Serum TBA level was measured by a biochemistry automatic analyzer. Logistic regression models with or without restricted cubic splines were performed.Results652 of 2773 pregnant women developed GDM. Women with GDM had higher serum TBA levels at the second trimester than that of healthy women (P < 0.001). Elevated serum TBA levels at the second trimester were associated with an increased risk of GDM in a dose-response manner. After the adjustment of age, BMI, smoking and drinking status, education background, lipid profiles, blood pressure, liver function, uric acid, bilirubin, urea nitrogen and creatinine, the odds ratios (ORs) of GDM for the highest (vs. the lowest) quartile were 1.83 (95% CI 1.10–3.38) in women. The inclusion of TBA levels at the second trimester in the model increased the area under the curve from 0.68 to 0.72 (95% CI: 0.68–0.76) (P < 0.05). Additionally, a higher serum TBA level was associated with higher odds of preterm birth (the highest quartile vs. the lowest quartile, AOR 1.91, 95% CI 1.26–2.98, P-trend = 0.017) and preeclampsia (the highest quartile vs. the lowest quartile, AOR 2.07, 95% CI 1.19–3.63, P-trend = 0.002). Furthermore, the U-shaped relationship was observed between TBA levels and the risk of premature rupture of membranes, with the lowest risk in the TBA concentration of 3.14 µmol/L.ConclusionWomen with higher fasting serum TBA levels at the second trimester have higher risk for development of GDM, preterm birth and preeclampsia.