Although previous research has indicated a correlation between smoking and the mortality rate in patients with lung cancer, the impact of early life factors on this relationship remains unclear and requires further investigation. This study aimed to investigate the hypothesis that breastfeeding reduces the risk of lung cancer-related death. The authors conducted a prospective cohort study involving 501859 participants recruited from the United Kingdom Biobank to explore the potential association between breastfeeding and the risk of lung cancer mortality using a Cox proportional hazards model. Subsequently, the polygenic risk score for lung cancer was calculated to detect interactions between genes and the environment. Over a median follow-up duration of 11.8 years, encompassing a total of 501859 participants, breastfeeding was found to reduce the risk of lung cancer-related death and the impact of maternal smoking on lung cancer mortality in adult offspring. This association remained consistent after stratification. Furthermore, the influence of maternal smoking and breastfeeding on the risk of lung cancer mortality was significant at a high genetic risk level. Breastfeeding can reduce the risk of lung cancer-related death and the impact of maternal smoking on lung cancer mortality in adult offspring. This correlation has the potential to reduce the probability of lung-cancer-related deaths in subsequent generations.