Females with a history of gestational diabetes mellitus (GDM) are at higher risk of developing type 2 diabetes mellitus (T2D) later in life. This study prospectively examined whether greater habitual coffee consumption was related to a lower risk of T2D among females with a history of GDM. We followed 4522 participants with a history of GDM in the NHS II for incident T2D between 1991 and 2017. Demographic, lifestyle factors including diet, and disease outcomes were updated every 2-4 y. Participants reported consumption of caffeinated and decaffeinated coffee on validated FFQs. Fasting blood samples were collected in 2012-2014 from a subset of participants free of diabetes to measure glucose metabolism biomarkers (HbA1c, insulin, C-peptide; n = 518). We used multivariable Cox regression models to calculate adjusted HRs and 95% CIs for the risk of T2D. We estimated the least squares mean of glucose metabolic biomarkers according to coffee consumption. A total of 979 participants developed T2D. Caffeinated coffee consumption was inversely associated with the risk of T2D. Adjusted HR (95% CI) for ≤1 (nonzero), 2-3, and 4+ cups/d compared with 0 cup/d (reference) was 0.91 (0.78, 1.06), 0.83 (0.69, 1.01), and 0.46 (0.28, 0.76), respectively (P-trend = 0.004). Replacement of 1 serving/d of sugar-sweetened beverage and artificially sweetened beverage with 1 cup/d of caffeinated coffee was associated with a 17% (risk ratio [RR] = 0.83, 95% CI: 0.75, 0.93) and 9% (RR = 0.91, 95% CI: 0.84, 0.99) lower risk of T2D, respectively. Greater caffeinated coffee consumption was associated with lower fasting insulin and C-peptide concentrations (all P-trend <0.05). Decaffeinated coffee intake was not significantly related to T2D but was inversely associated with C-peptide concentrations (P-trend = 0.003). Among predominantly Caucasian females with a history of GDM, greater consumption of caffeinated coffee was associated with a lower risk of T2D and a more favorable metabolic profile.