Epidemiological studies show that adherence to a Mediterranean diet (MD) increases longevity; however, few studies are restricted to Mediterranean populations or explore the effect of a MD pattern that directly incorporates olive oil. Therefore the relationship between adherence to the MD and mortality was studied within the the Spanish cohort of the European Prospective Investigation into Cancer and Nutrition (EPIC-Spain). The EPIC-Spain analysis included 40 622 participants (37·7 % males) aged 29–69 years who were recruited from five Spanish regions in 1992–1996. During a mean follow-up of 13·4 years, 1855 deaths were documented: 913 from cancer, 399 from CVD, 425 from other causes and 118 from unknown causes of death. Risk of all-cause and cause-specific mortality was assessed according to the level of adherence to a relative MD (rMED) score, measured using an 18-unit scale incorporating nine selected dietary components. A high compared with a low rMED score was associated with a significant reduction in mortality from all causes (hazard ratio (HR) 0·79; 95 % CI 0·69, 0·91), from CVD (HR 0·66; 95 % CI 0·49, 0·89), but not from overall cancer (HR 0·92; 95 % CI 0·75, 1·12). A 2-unit increase in rMED score was associated with a 6 % (P < 0·001) decreased risk of all-cause mortality. A high olive oil intake and moderate alcohol consumption contributed most to this association. In this Spanish cohort, following an olive oil-rich MD was related to a significant reduction in all-cause mortality, and reduced the risk of mortality from CVD. These results support the important role that the MD pattern has on reducing mortality in Mediterranean countries.