To examine the combined impact of migraine and gestational diabetes mellitus (GDM) on the risks of premature (persons aged ≤60 years) major adverse cardiovascular and cerebrovascular events (MACCE) based on a composite endpoint of fatal and non-fatal myocardial infarction (MI) and stroke. Migraine and GDM are risk factors for cardiovascular disease. It is unknown how the combination of migraine and GDM may affect cardiovascular disease risk. In a Danish population-based cohort longitudinal study, we established four cohorts among women with at least one pregnancy during 1996-2018: women with migraine, women with GDM, women with both migraine and GDM, and women free of migraine and free of GDM. Risks of premature MACCE and component endpoints were assessed for each cohort. We included 1,307,456 women free of migraine and free of GDM, 56,811 women with migraine, 24,700 women with GDM, and 1484 women with migraine and GDM. The 20-year absolute risk of MACCE was 1.3% (MI: 0.4%, ischemic stroke: 0.6%, hemorrhagic stroke: 0.3%) among women free of migraine and free of GDM, 2.3% (MI: 0.8%, ischemic stroke: 1.2%, hemorrhagic stroke: 0.5%) among women with migraine, 2.2% (MI: 1.0%, ischemic stroke: 1.0%, hemorrhagic stroke: 0.4%) among women with GDM, and 3.7% (MI: 1.7%, ischemic stroke: 1.7%, hemorrhagic stroke: 0.3%) among women with both migraine and GDM. The 20-year adjusted hazard ratio of premature MACCE was 1.65 (95% confidence interval [CI] 1.49-1.82) for women with migraine; 1.64 (95% CI 1.37-1.96) for women with GDM; and 2.35 (95% CI 1.03-5.36) for women with both GDM and migraine when compared with women free of migraine and free of GDM. Migraine and GDM were each independently associated with an increased risk of MACCE. Risk of premature MACCE was greatest among women with both migraine and GDM, although this risk estimate was imprecise.