Background The knowledge gap regarding whether the correlation between atrial fibrillation (AF) and dementia in observational studies is causation or driven by other shared risk factors remains substantially unfilled. Methods and Results We performed a comprehensive 2-sample Mendelian randomization study to evaluate the causal effect of AF on overall dementia and its subtypes, including vascular dementia, Alzheimer dementia, Lewy body dementia, and frontotemporal dementia. The primary results in inverse variance-weighted analyses were further validated by various Mendelian randomization sensitivity analyses. Additionally, we conducted multivariable Mendelian randomization to examine 10 candidate mediators of the causal association of AF and dementia. Genetic predisposition to AF was modestly associated with an increased risk of overall dementia (odds ratio, 1.140 [95% CI, 1.023-1.271]; P=0.018) and strongly associated with vascular dementia (odds ratio, 1.350 [95% CI, 1.076-1.695]; P=0.010). Genetically predicted AF indicated neutral effects on Alzheimer dementia, Lewy body dementia, and frontotemporal dementia. In multivariable Mendelian randomization analysis, the total effect of AF on overall dementia was remarkably attenuated by adjusting for genetic effect for ischemic stroke (odds ratio, 1.068 [95% CI, 0.953-1.197]; P=0.259) and low cardiac output (odds ratio, 1.046 [95% CI, 0.926-1.181]; P=0.475), indicating that the causal association of genetically predicted AF with dementia was potentially mediated by ischemic stroke and low cardiac output. The causal effect of genetically predicted AF on dementia was independent of cerebral small-vessel disease and brain volume phenotypes. Conclusions Our findings provided novel evidence supporting the causal effect of genetically predicted AF on dementia mediated by ischemic stroke and low cardiac output. Future clinical trials are warranted to evaluate the potential role of appropriate AF management in dementia prevention.