Background: Cardiovascular risk factors are associated with a higher risk of developing dementia. Studies in older populations, however, have often failed to show this relationship. We assessed the association between cardiovascular risk factors measured in midlife and risk of being hospitalised with dementia and determined whether this association was modified by age and ethnicity. Methods: We studied 11 151 participants in the population-based Atherosclerosis Risk in Communities cohort, aged 46-70 (23% African-Americans) in 1990-2, when participants underwent a physical exam and cognitive testing. Hospitalisations with dementia were ascertained through December 2004. Results: During follow-up, 203 cases of hospitalisation with dementia were identified. Smoking (hazard ratio (HR), 95% CI 1.7, 1.2 to 2.5), hypertension (HR, 95% CI 1.6, 1.2 to 2.2) and diabetes (HR, 95% CI 2.2, 1.6 to 3.0) were strongly associated with dementia, in Caucasians and African-Americans. These associations were stronger when risk factors were measured at a younger age than at an older age. In analyses including updated information on risk factors during follow-up, the HR of dementia in hypertensive versus non-hypertensive participants was 1.8 at age <55 years compared with 1.0 at age 70+ years. Parallel results were observed for diabetes (HR 3.4 in <55, 2.0 in ≥70), smoking (4.8 in <55, 0.5 in ≥70) and hypercholesterolaemia (HR 1.7 in <55, 0.9 in ≥70) Conclusion: In this prospective study, smoking, hypertension and diabetes were strongly associated with subsequent risk of hospitalisation with dementia, particularly in middle-aged individuals. Our results emphasise the importance of early lifestyle modification and risk factor treatment to prevent dementia.