Background: Gestational diabetes mellitus (GDM) is associated with both short-and long-term adverse health consequences for both the mother and her offspring. The aim was to study the prevalence and risk factors for GDM in Beijing. Methods: The study population consisted of 15,194 pregnant women attending prenatal care in 15 hospitals in Beijing, who delivered between June 20, 2013, and November 30, 2013, after 28 weeks of gestation. The participants were selected by cluster sampling from the 15 hospitals identified through random systematic sampling based on the number of deliveries in 2012. A questionnaire was designed to collect information. Results: A total of 2987 (19.7%) women were diagnosed with GDM and 208 (1.4%) had diabetes in pregnancy (DIP). Age (OR: 1.053, 95% CI: 1.033-1.074, P < 0.01), family history of diabetes mellitus (OR: 1.481, 95% CI: 1.254-1.748, P < 0.01), prepregnancy body mass index (BMI) (OR: 1.481,95% CI: 1.254-1.748, P < 0.01), BMI gain before 24 weeks (OR: 1.126, 95% CI: 1.075-1.800, P < 0.01), maternal birth weight (P < 0.01), and fasting plasma glucose at the first prenatal visit (P < 0.01) were identified as risk factors for GDM. In women with birth weight < 3000 g, GDM rate was significantly higher. Conclusions: One out of every five pregnant women in Beijing either had GDM or DIP and this constitutes a huge health burden for health services. Prepregnancy BMI and weight gain before 24 h week are important modifiable risk factors for GDM. Ensuring birth weight above 3000 g may help reduce risk for future GDM among female offsprings.