Background. With the number of people with dementia increasing, identifying potential protective factors has become more important. We explored the association between physical exercise at midlife and subsequent risk of dementia among members of the HARMONY study. Methods. Measures of exercise were obtained by the Swedish Twin Registry an average of 31 years prior to dementia assessment. Dementia was diagnosed using a two-stage procedure - screening for cognitive impairment followed by full clinical evaluation. We used two study designs: case-control analyses included 264 cases with dementia (176 had Alzheimer's disease) and 2870 controls; co-twin control analyses included 90 twin pairs discordant for dementia. Results. In case-control analyses, controlling for age, sex, education, diet (eating fruits and vegetables), smoking, drinking alcohol, body mass index, and angina, light exercise such as gardening or walking and regular exercise involving sports were associated with reduced odds of dementia compared to hardly any exercise (odds ratio [OR] = 0.63, 95% confidence interval [CI], 0.43-0.91 for light exercise; OR = 0.34, 95% CI, 0.16-0.72 for regular exercise). Findings were similar for Alzheimer's disease alone. In co-twin control analyses, controlling for education, the association between higher levels of exercise and lower odds of dementia approached significance (OR = 0.50, 95% CI, 0.23-1.06; p = .072). Conclusions. Exercise at midlife may reduce the odds of dementia in older adulthood, suggesting that exercise interventions should be explored as a potential strategy for delaying disease onset. Copyright 2008 by The Gerontological Society of America.