This study cross-sectionally examines in the elderly population: (a) the association of type 2 diabetes with executive function (EF); (b) the effect of BMI on both type 2 diabetes and EF; (c) the association between glycaemia control and EF in type 2 diabetes. 6823 older individuals with overweight/obesity and metabolic syndrome participating in the PREDIMED-PLUS study, were assessed with a battery of cognitive tests and a medical interview. ANOVA showed a significantly worse performance on EF in type 2 diabetes vs. non-diabetic individuals. Two complementary models were displayed: (1) in the whole sample, the presence of type 2 diabetes, depressive symptoms and BMI had a direct negative effect on EF, while apnoea had an indirect negative effect; (2) in the diabetes subsample, higher illness duration was associated with worse performance in EF. Participants with type 2 diabetes and HbA1c<53 mmol/mol displayed better cognitive performance when compared to those with HbA1c≥53 mmol/mol. Our results provide a controlled comprehensive model that integrates relevant neuropsychological and physical variables in type 2 diabetes. The model suggests that, to improve treatment adherence and quality of life once diabetes has been diagnosed, cognitive decline prevention strategies need to be implemented while monitoring depressive symptoms, BMI and glycaemia control.