Abstract Background Lifestyle risk factors for coronary artery disease (CAD) have been associated with neurodegeneration and dementia. Whether an underlying genetic risk for the development of CAD further increases this risk, however, remains unclear. Purpose To examine whether an increased genetic risk for CAD is associated with an increased risk of dementia, and to investigate whether lifestyle factors modify these associations. Methods A prospective cohort study of 457,353 participants of European ancestry without dementia at baseline (mean [SD], age 57 [8] years; 55% were female) was conducted within the UK Biobank study. Exposures were a genome-wide polygenic risk score (PRS) for CAD and a modified version of the American Heart Association’s Life’s Essential 8 (LE8) cardiovascular health score comprising four biological (BMI, BP, lipids, glucose) and four lifestyle (smoking status, diet, physical activity, and sleep duration) risk factors previously linked to both CAD and dementia. Dementia diagnoses were obtained from death register and inpatient records. Results 9,337 cases of all-cause dementia were observed over a median 13.9-year follow-up. There were no significant interactions between genetic risk for CAD and lifestyle factors for all-cause dementia, or any other dementia subtype. After adjusting for potential demographic confounders, a higher genetic risk for CAD was associated with elevated risk of developing all-cause dementia (hazard ratio (HR) per 1-SD increase in PRS = 1.08 [95% CI, 1.05-1.10]), Alzheimer’s disease (HR 1.08 [1.03-1.12]), and vascular dementia (HR 1.13 [1.06-1.19]). An unfavourable LE8 cardiovascular health score was also associated with an increased risk of developing all-cause dementia (HR 1.05 [1.02-1.08]), predominantly through its association with vascular dementia (HR 1.14 [1.06-1.22]), as we found no evidence for any associations between LE8 and Alzheimer’s disease (HR 1.00 [0.97-1.02]). Conclusion These findings indicate that a high genetic risk for CAD is associated with an increased risk of developing major dementia subtypes. Regardless of this underlying genetic risk, however, our results suggest that lifestyle interventions designed to reduce the risk of CAD may also reduce one’s risk of developing dementia, particularly in those with underlying vascular pathology.