Objectives First, the association between serum 25-hydroxyvitamin D (25[OH]D) and cognitive performance was examined. Second, we assessed whether there was evidence for an interplay between 25(OH)D and glucose homeostasis in the association with cognitive performance. Design, Setting, and Participants Associations were studied using cross-sectional data of 776 (3 domains) up to 2722 (1 domain) Dutch community-dwelling older adults, aged 65 years or older. Measurements Serum 25(OH)D, plasma glucose, and insulin concentrations were obtained. Cognitive performance was assessed with an extensive cognitive test battery. Prevalence ratios (PRs) were calculated to quantify the association between 25(OH)D and cognition; poor performance was defined as the worst 10% of the distribution of the cognitive scores. Results The overall median MMSE score was 29 (IQR 28–30). Higher serum 25(OH)D was associated with better attention and working memory, PR 0.50 (95% CI 0.29–0.84) for the third serum 25(OH)D tertile, indicating a 50% lower probability of being a poor performer than participants in the lowest tertile. Beneficial trends were shown for 25(OH)D with executive function and episodic memory. Serum 25(OH)D was not associated with plasma glucose or insulin. Plasma insulin only modified the association between serum 25(OH)D and executive function (P for interaction: .001), suggesting that the improvement in executive function with high 25(OH)D concentrations is stronger in participants with high plasma insulin concentrations compared with those with low plasma insulin concentrations. Conclusion Higher 25(OH)D concentrations significantly associated with better attention and working memory performance. This study does not demonstrate an interplay between serum 25(OH)D and glucose homeostasis in the association with cognitive performance.