BackgroundThe COVID-19 pandemic has had indirect effects on pregnancy outcomes. There is limited data on the impact on gestational diabetes (GDM) in diverse populations and the possible underlying mediators. This study aimed to assess the risk of GDM pre-COVID-19 and in two distinct pandemic exposure periods, and to determine the potential factors contributing to increased risk in a multiethnic population.MethodsA multicentre, retrospective cohort study was performed of women with singleton pregnancy receiving antenatal care at three hospitals two years pre-COVID-19 (January 2018 – January 2020), first year of COVID-19 with limited pandemic-mitigating restrictions (February 2020 – January 2021) and second year of COVID-19 with stringent restrictions (February 2021 – January 2022). Baseline maternal characteristics and gestational weight gain (GWG) were compared between cohorts. The primary outcome was GDM, assessed using univariate and multivariate generalised estimating equations models.Results28,207 pregnancies met the inclusion criteria, 14,663 pregnancies two years pre-COVID-19, 6,890 in COVID-19 Year 1 and 6,654 in COVID-19 Year 2. Maternal age increased across exposure periods (30.7 ± 5.0 years pre-COVID-19 vs 31.0 ± 5.0 years COVID-19 Year 1 vs 31.3 ± 5 years COVID-19 Year 2;p< 0.001). There were increases in pre-pregnancy body mass index (BMI) (25.5 ± 5.7 kg/m2vs 25.7 ± 5.6 kg/m2vs 26.1 ± 5.7 kg/m2;p< 0.001), proportion who were obese (17.5% vs 18.1% vs 20.7%;p< 0.001) and proportion with other traditional risk factors for GDM including South Asian ethnicity and prior history of GDM. Rate of GWG and proportion exceeding recommended GWG increased with pandemic exposure (64.3% vs 66.0% vs 66.6%;p= 0.009). GDM diagnosis increased across exposure periods (21.2% vs 22.9% vs 24.8%;p< 0.001). Both pandemic exposure periods were associated with increased risk of GDM on univariate analysis, only COVID-19 Year 2 remaining significantly associated after adjusting for maternal baseline characteristics and GWG (OR 1.17 [1.06, 1.28],p= 0.01).ConclusionsDiagnosis of GDM increased with pandemic exposure. Progressive sociodemographic changes and greater GWG may have contributed to increased risk. However, exposure to the second year of COVID-19 remained independently associated with GDM after adjusting for shifts in maternal characteristics and GWG.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12884-023-05659-6.