The exact etiology of dementia is still unclear, but both genetic and lifestyle factors are thought to be key drivers of this complex disease. The recognition of familial patterns of dementia has led to the discovery of genetic factors that have a role in the pathogenesis of dementia, including the apolipoprotein E (APOE) genotype and a large and still-growing number of genetic variants1,2. Beyond genetic architecture, several modifiable risk factors have been implicated in the development of dementia3. Prevention trials of measures to halt or delay cognitive decline are increasingly recruiting older individuals who are genetically predisposed to dementia. However, it remains unclear whether targeted health and lifestyle interventions can attenuate or even offset increased genetic risk. Here, we leverage long-term data on both genetic and modifiable risk factors from 6,352 individuals aged 55 years and older in the population-based Rotterdam Study. In this study, we demonstrate that, in individuals at low and intermediate genetic risk, favorable modifiable-risk profiles are related to a lower risk of dementia compared to unfavorable profiles. In contrast, these protective associations were not found in those at high genetic risk.