OBJECTIVE To evaluate the association between consumption of ultra-processed foods and all cause mortality. DESIGN Prospective cohort study. SETTING Seguimiento Universidad de Navarra (SUN) cohort of university graduates, Spain 1999-2018. PARTICIPANTS 19 899 participants (12 113 women and 7786 men) aged 20-91 years followed-up every two years between December 1999 and February 2014 for food and drink consumption, classified according to the degree of processing by the NOVA classification, and evaluated through a validated 136 item food frequency questionnaire. MAIN OUTCOME MEASURE Association between consumption of energy adjusted ultra-processed foods categorised into quarters (low, low-medium, medium-high, and high consumption) and all cause mortality, using multivariable Cox proportional hazard models. RESULTS 335 deaths occurred during 200 432 persons years of follow-up. Participants in the highest quarter (high consumption) of ultra-processed foods consumption had a higher hazard for all cause mortality compared with those in the lowest quarter (multivariable adjusted hazard ratio 1.62, 95% confidence interval 1.13 to 2.33) with a significant dose-response relation (P for linear trend=0.005). For each additional serving of ultra-processed foods, all cause mortality relatively increased by 18% (adjusted hazard ratio 1.18, 95% confidence interval 1.05 to 1.33). CONCLUSIONS A higher consumption of ultra-processed foods (>4 servings daily) was independently associated with a 62% relatively increased hazard for all cause mortality. For each additional serving of ultra-processed food, all cause mortality increased by 18%.