To examine the long term mortality associated with preterm delivery in a large population based cohort of women, and to assess for potential confounding by shared familial factors.National cohort study.Sweden.All 2 189 477 women with a singleton delivery in 1973-2015.All cause and cause specific mortality up to 2016, identified from nationwide death records. Cox regression was used to calculate hazard ratios while adjusting for confounders, and co-sibling analyses assessed the potential influence of unmeasured shared familial (genetic and environmental) factors.In 50.7 million person years of follow-up, 76 535 (3.5%) women died (median age at death was 57.6). In the 10 years after delivery, the adjusted hazard ratio for all cause mortality associated with preterm delivery (<37 weeks) was 1.73 (95% confidence interval 1.61 to 1.87), and when further stratified was 2.20 (1.63 to 2.96) for extremely preterm delivery (22-27 weeks), 2.28 (2.01 to 2.58) for very preterm delivery (28-33 weeks), 1.52 (1.39 to 1.67) for late preterm delivery (34-36 weeks), and 1.19 (1.12 to 1.27) for early term delivery (37-38 weeks) compared with full term delivery (39-41 weeks). These risks declined but remained significantly raised after longer follow-up times: for preterm versusfull term births, 10-19 years after delivery, the adjusted hazard ratio was 1.45 (95% confidence interval 1.37 to 1.53); 20-44 years after delivery, the adjusted hazard ratio was 1.37 (1.33 to 1.41). These findings did not seem to be attributable to shared genetic or environmental factors within families. Several causes were identified, including cardiovascular and respiratory disorders, diabetes, and cancer.In this large national cohort of women, the findings suggested that preterm and early term delivery were independent risk factors for premature mortality from several major causes. These associations declined over time but remained raised up to 40 years later.