Introduction: The influence of women's childhood psychosocial environment and subsequent preconception mental health on risk of developing gestational diabetes mellitus is unclear. This study examines this relationship. Methods: Data from a population-based cohort study, the Australian Longitudinal Study on Women's Health, were used. A total of 6,317 women with no pre-existing diabetes were followed from 1996 (aged 18–23 years) until 2015. Gestational diabetes mellitus diagnosis was self-reported. Exposures to eight subcategories of adverse childhood experiences were recalled. Individual subcategories and total number of adverse childhood experiences were examined. Log-binomial regression models with generalized estimating equations were used to estimate RRs and 95% CIs. Analyses were adjusted for early life, preconception, and antenatal gestational diabetes mellitus risk factors. Effect modification by preconception mental health was tested using cross-product terms. Analyses were conducted in 2018. Results: Among 11,556 pregnancies, 4.7% were complicated by gestational diabetes mellitus. Compared with women not exposed to adverse childhood experiences, exposure to any three adverse childhood experiences (6% of women, adjusted RR=1.73, 95% CI=1.02, 3.01) or four or more adverse childhood experiences (7%, adjusted RR=1.76, 95% CI=1.04, 2.99) was associated with elevated gestational diabetes mellitus risk in women with preconception depressive symptoms. Among the subcategories of adverse childhood experiences, physical abuse, and household substance abuse were associated with higher gestational diabetes mellitus risk. Adverse childhood experiences were not associated with gestational diabetes mellitus in women without depressive symptoms before pregnancy (p=0.01, for interaction). Conclusions: These findings suggest that, in addition to primary prevention of childhood adversity, strategies to curb poor mental health trajectories among women exposed to adverse childhood experiences may contribute to prevention of gestational diabetes mellitus.