The aim of the present study was to assess the impact of obesity and gestational weight gain on the risk of subtypes of preterm birth, because little is known about these associations. The study included 62 167 women within the Danish National Birth Cohort for whom self-reported information about prepregnancy body mass index (BMI) and gestational weight gain was available. Information about spontaneous preterm birth with or without preterm premature rupture of membranes (PPROM) and about induced preterm deliveries was obtained from national registers. Cox regression analyses were used to examine associations of prepregnancy BMI and gestational weight gain with subtypes of preterm birth. The crude risks of PPROM and of induced preterm deliveries were higher in obese women (BMI > or = 30) than in normal-weight women (18.5 < or = BMI < 25), especially before 34 completed weeks of gestation, when obese women faced twice the risk. In the adjusted analysis, the hazard ratios and 95% confidence intervals for PPROM and for induced preterm delivery in obese women were 1.5 [1.2, 1.9] and 1.2 [1.0, 1.6] respectively. When obesity-related diseases were accounted for, no excess risk of induced preterm deliveries was seen in obese women, but the increased risk of PPROM was unchanged. Low weight gain was associated with an increased risk of all subtypes of preterm birth compared with normal weight gain, especially in early spontaneous preterm births, where the risk was doubled. We concluded that prepregnancy obesity was associated with a higher risk of PPROM and early induced preterm deliveries.