ObjectiveThis study aims to explore the association between outdoor artificial light at night (ALAN) exposure and gestational diabetes mellitus (GDM).MethodsThis study is a retrospective case–control study. According with quantiles, ALAN has been classified into three categories (Q1-Q3). GDM was diagnosed through oral glucose tolerance tests. Conditional logistic regression models were used to evaluate the association between ALAN exposure and GDM risk. The odds ratio (OR) with 95% confidence interval (CI) was used to assess the association. Restricted cubic spline analysis (RCS) was utilized to investigate the no liner association between ALAN and GDM.ResultsA total of 5,720 participants were included, comprising 1,430 individuals with GDM and 4,290 matched controls. Pregnant women exposed to higher levels of ALAN during the first trimester exhibited an elevated risk of GDM compared to those with lower exposure levels (Q2 OR = 1.39, 95% CI 1.20–1.63, p < 0.001); (Q3 OR = 1.70, 95% CI 1.44–2.00, p < 0.001). Similarly, elevated ALAN exposure during the second trimester also conferred an increased risk of GDM (second trimester: Q2 OR = 1.70, 95% CI 1.45–1.98, p < 0.001; Q3 OR = 2.08, 95% CI 1.77–2.44, p < 0.001). RCS showed a nonlinear association between ALAN exposure and GDM risk in second trimester pregnancy, with a threshold value of 4.235.ConclusionOutdoor ALAN exposure during pregnancy is associated with an increased risk of GDM.