Background. Coffee consumption has been associated with a decreased risk of type 2 diabetes mellitus. We examined the relationship between coffee consumption and the risk of gestational diabetes mellitus [GDM]. Methods. In this prospective study, 1744 non-diabetic pregnant women were questioned during early gestation about their coffee consumption. We studied the association of coffee consumption before and during pregnancy, and the subsequent risk of GDM. Generalised, linear models were fitted to estimate risk ratios and 95% confidence intervals. Results. Women who reported moderate pre-pregnancy caffeinated coffee intake had a significantly reduced risk of GDM (adjusted RR 0.50; 95% CI 0.29–0.85) compared with non-consumers. No risk reduction was associated with decaffeinated coffee intake. Conclusions. Moderate pre-pregnancy caffeinated coffee consumption may have a protective association with GDM. Prospective studies, including a wider range of consumption habits, are necessary.