Consensus statements by various countries have reported age, obesity, and family history of diabetes mellitus as risk factors for gestational diabetes mellitus. Other factors remain controversial. The aim of this study was to investigate factors associated with gestational diabetes among mothers of newborns from the birth cohort in Pelotas, Rio Grande do Sul State, Brazil, in 2004. We interviewed 4,243 postpartum women in hospital, with a 0.5% refusal rate. Diagnosis of gestational diabetes was self-reported. Prevalence of gestational diabetes was 2.95% (95%CI: 2.53-3.64). Crude analysis using the chi-square test showed a direct association with age, schooling, socioeconomic status, and body mass index (BMI) and an inverse association with maternal height. Non-white color, family history of diabetes mellitus, smoking in the first and second trimesters, and physical activity before the pregnancy and in the first trimester were associated with the outcome. Adjusted hierarchical analysis using logistic regression showed an association with age, non-white color, higher schooling, family history of diabetes, and BMI. Height showed borderline significance. Smoking in the first and second trimesters showed a protective effect.