BACKGROUND Although there is evidence that vitamin D inadequacy may be linked to adverse cognitive outcomes, results have been inconsistent. The aim of our study was to examine the association between 25-hydroxyvitamin D (25(OH)D) levels and cognitive performance in middle-aged and older European men. METHODS This population-based cross-sectional study included 3,369 men aged 40 to 79 years from eight centres enrolled in the European Male Ageing Study (EMAS). Cognitive function was assessed using the Rey-Osterrieth Complex Figure test (ROCF), the Camden Topographical Recognition Memory test (CTRM) and the Digit Symbol Substitution test (DSST). Serum 25(OH)D levels were measured by radioimmunoassay. Additional assessments included physical activity, functional performance and mood/depression. Associations between cognitive function and 25(OH)D were explored using locally weighted and linear regression models. RESULTS 3,133 men, mean (±SD) age 60±11 years were included in the analysis. The mean 25(OH)D concentration was 63±31 nmol/L. In age-adjusted linear regressions higher levels of 25(OH)D were associated with higher scores on the ROCF-copy (β per 10 nmol/L=0.096; 95%CI 0.049-0.144), CTRM (β per 10 nmol/L=0.075; 95%CI 0.026-0.124) and DSST (β per 10 nmol/L=0.318; 95%CI 0.235-0.401) tests. After adjusting for additional confounders, 25(OH)D levels were associated with the DSST test only (β per 10 nmol/L=0.152; 95%CI 0.051-0.253). Locally weighted and spline regressions suggested the relationship between 25(OH)D and cognitive function was most pronounced at 25(OH)D concentrations below 35 nmol/L. CONCLUSION In this study lower 25(OH)D levels were associated with poorer performance on the DSST test. Further research is warranted to determine whether vitamin D sufficiency may play a role in preserving cognitive function in older adults.