Preeclampsia and gestational hypertension are common pregnancy complications associated with adverse maternal and offspring outcomes. Current tools for prediction, prevention, and treatment are limited. In discovery analysis, we tested the association of maternal DNA sequence variants with preeclampsia in 17,150 cases and 451,241 controls and with gestational hypertension in 8,961 cases and 184,925 controls using multi-ancestry meta-analysis. We identified 12 independent loci associated with preeclampsia/eclampsia, 7 of which are novel (including MTHFR-CLCN6, WNT3A, PGR, FLT1, and RGL3), and 7 loci associated with gestational hypertension. Identified loci highlight the role of natriuretic peptide signaling, angiogenesis, renal glomerular function, trophoblast development, and immune dysregulation. We derived genome-wide polygenic risk scores that predicted preeclampsia/eclampsia and gestational hypertension in external datasets, independent of first-trimester risk markers. Collectively, these findings provide mechanistic insights into the hypertensive disorders of pregnancy and advance pregnancy risk stratification.