Human cognitive performance is a key function whose biological foundations have been partially revealed by genetic and brain imaging studies. The sleep electroencephalogram (EEG) is tightly linked to structural and functional features of the central nervous system and serves as another promising biomarker. We used data from MrOS, a large cohort of older men and cross-validated regularized regression to link sleep EEG features to cognitive performance in cross-sectional analyses. In independent validation samples 2.5-10% of variance in cognitive performance can be accounted for by sleep EEG features, depending on the covariates used. Demographic characteristics account for more covariance between sleep EEG and cognition than health variables, and consequently reduce this association by a greater degree, but even with the strictest covariate sets a statistically significant association is present. Sigma power in NREM and beta power in REM sleep were associated with better cognitive performance, while theta power in REM sleep was associated with worse performance, with no substantial effect of coherence and other sleep EEG metrics. Our findings show that cognitive performance is associated with the sleep EEG (r = 0.283), with the strongest effect ascribed to spindle-frequency activity. This association becomes weaker after adjusting for demographic (r = 0.186) and health variables (r = 0.155), but its resilience to covariate inclusion suggest that it also partially reflects trait-like differences in cognitive ability.