Abstract Background Cognitive function is fundamental to healthy aging and independent living. As there is no cure for dementia, prevention of risk factors (e. g. physical inactivity, obesity, hypertension, diabetes, social isolation, depression) is crucial. The aim of our study was to analyze selected dementia risk factors and their association with cognitive function in people aged 65 years and older. Methods Cross-sectional data from the nationally representative examination Study on Health of Older People in Germany (Gesundheit 65+) conducted between 2022-2023 by the Robert Koch Institute (n = 1.493; 48% women; mean age 78.8 years). Cognitive function was assessed by the Letter Digit Substitution Test (LDST), a measure of general speed of information processing, and of the Consortium to Establish a Registry for Alzheimer’s Disease (CERAD) 10-word list delayed recall (WLR), a measure of memory. Weighted associations between age, sex, education, dementia risk scores and z-standardized test scores were examined using linear regression analysis. Results Higher age, male sex and lower level of education were significantly associated with lower z-scores in both tests (all p < 0.001). In separate models, all adjusted for age, sex and education, social isolation was associated with lower performance on both LDST (ß=-0.22; 95% confidence interval -0.42, -0.01) and CERAD WLR (ß=-0.21; -0.41, -0.01); depressive symptoms were associated with lower LDST z-scores (ß=-0.40; -0.67, -0.13), and physical inactivity with lower CERAD WLR z-scores (ß=-0.12; -0.24, -0.01). Obesity, hypertension, and diabetes were not significantly associated with any test. Conclusions Our findings from this nationwide general population study of old and very old adults show a clustering of reduced cognitive function with social isolation, symptoms of mental health impairments, and physical inactivity in old age which call for coordinated intersectoral health promotion and prevention activities. Key messages • The clustering of reduced cognition with dementia risk factors calls for intersectoral health actions. • Limitations in cognition should only be defined by age-, sex-, and education-specific norms.