Gestational diabetes mellitus (GDM) is any degree of glucose intolerance with onset or first detection during pregnancy, with an inconsistent association with serum ferritin (SF). We aimed to ascertain the relationship between SF and the risk of GDM in mid-pregnancy and provide evidence for implementing clinical individualized and reasonable iron supplementation regimens. A retrospective study was conducted to investigate 1,052 pregnant women at 24-28 weeks of gestation who were examined in the obstetrics department of The Fourth Hospital of Shijiazhuang from January 2019 to December 2021. Questionnaires were used to obtain the general information. The levels of serum ferritin (SF), serum calcium, glycated haemoglobin (HbA1c) and Oral-Glucose-Tolerance-Test (OGTT) were reviewed. The GDM was diagnosed by glucose tests. Multivariate logistic regression was used to determine the relationship between serum ferritin and GDM. Compared to the non-GDM group, the GDM group had significantly higher level of SF (13.95 (8.59-23.65) ng/mL vs. 12.11 (7.27-19.86) ng/mL, (p = 0.012)). While SF levels positively correlated with 1-hour plasma glucose levels (PG1H) (r = 0.061, p = 0.047), there was a negative correlation between SF and HbA1c levels (r = - 0.078, p = 0.011). The risk of GDM with higher levels of SF was increased (1.010 (95% CI [1.001-1.020], p = 0.025)). In the univariate logistic regression model, the risk of GDM in pregnant women with high ferritin levels was 1.010 (95% CI [1.001-1.020], p = 0.025). After adjustment for age and pre-pregnancy body mass index (BMI), the risk of GDM was significantly increased by 44% and 42% respectively (adjusted odds ratio (AOR) = 1.440, 95% CI [1.025-2.023], p = 0.035), AOR = 1.420 (95% CI [1.011-1.995], p = 0.043). After multivariate adjustment for age and pre-pregnancy BMI, the results were moderately revised (AOR = 1.427, 95%CI [1.013-2.008], p = 0.042). Elevated SF levels of mid-pregnancy was associated with risk of GDM, which may guide the implementation of pregnancy-specific supplementation to some extent with the support of further clinical trials.