AbstractObjective:To evaluate the effects of gestational weight gain (GWG) in the first trimester (GWG-F) and the rate of gestational weight gain in the second trimester (RGWG-S) on gestational diabetes mellitus (GDM), exploring the optimal GWG ranges for the avoidance of GDM in Chinese women.Design:A population-based prospective study was conducted. Gestational weight was measured regularly in every antenatal visit and assessed by the Institute of Medicine (IOM) criteria (2009). GDM was assessed with the 75-g, 2-h oral glucose tolerance test at 24–28 weeks of gestation. Multivariable logistic regression was performed to assess the effects of GWG-F and RGWG-S on GDM, stratified by pre-pregnancy BMI. In each BMI category, the GWG values corresponding to the lowest prevalence of GDM were defined as the optimal GWG range.Setting:Southwest China.Participants:Pregnant women (n 1910) in 2017.Results:After adjusting for confounders, GWG-F above IOM recommendations increased the risk of GDM (OR; 95 % CI) among underweight (2·500; 1·106, 5·655), normal-weight (1·396; 1·023, 1·906) and overweight/obese women (3·017; 1·118, 8·138) compared with women within IOM recommendations. No significant difference was observed between RGWG-S and GDM (P > 0·05) after adjusting for GWG-F based on the previous model. The optimal GWG-F ranges for the avoidance of GDM were 0·8–1·2, 0·8–1·2 and 0·35–0·70 kg for underweight, normal-weight and overweight/obese women, respectively.Conclusions:Excessive GWG in the first trimester, rather than the second trimester, is associated with increased risk of GDM regardless of pre-pregnancy BMI. Obstetricians should provide more pre-emptive guidance in achieving adequate GWG-F.