To assess the effect on cognition of a controlled intervention testing Mediterranean diets (MedDiet).Randomized trial after 6.5 years of nutritional intervention.Eight primary care centers affiliated to the University of Navarra.A random subsample of 285 participants (95 randomly allocated to each of 3 groups) of the PREDIMED-NAVARRA trial. All of them were at high vascular risk (44.8% men, 74.1±5.7 years at cognitive evaluation).Nutritional intervention comparing two MedDiets (supplemented with extra-virgin olive oil [EVOO] or mixed nuts) versus a low-fat control diet. Participants received intensive education to increase adherence to the intended intervention. Participants allocated to the MedDiet groups received EVOO (1 l/week) or 30 g/day of mixed nuts. Dietary habits were evaluated using a validated 137-item food frequency questionnaire (FFQ). Additionally, adherence to MedDiet was appraised using a 14-item questionnaire both at baseline and yearly thereafter.Cognitive performance as a main outcome and cognitive status (normal, mild cognitive impairment [MCI] or dementia) as a secondary outcome were evaluated by two neurologists blinded to group assignment after 6.5 years of nutritional intervention.Better post-trial cognitive performance versus control in all cognitive domains and significantly better performance across fluency and memory tasks were observed for participants allocated to the MedDiet+EVOO group. After adjustment for sex, age, education, apolipoprotein E genotype, family history of cognitive impairment/dementia, smoking, physical activity, body mass index, hypertension, dyslipidaemia, diabetes, alcohol and total energy intake, this group also showed lower MCI (OR=0.34 95% CI: 0.12-0.97) compared with control group. Participants assigned to MedDiet+Nuts group did not differ from controls.A long-term intervention with an EVOO-rich MedDiet resulted in a better cognitive function in comparison with a control diet. However, non-significant differences were found for most cognitive domains. Participants allocated to an EVOO-rich MedDiet had less MCI than controls.