Accumulating evidence shows that atrial fibrillation (AF) is associated with an increased risk of dementia. Catheter ablation for AF prolongs the duration of sinus rhythm, thereby improving the quality of life. We investigated the association of catheter ablation for AF with the occurrence of dementia.Using the Korean National Health Insurance Service database, among 194 928 adults with AF treated with ablation or medical therapy (antiarrhythmic or rate control drugs) between 1 January 2005 and 31 December 2015, we studied 9119 patients undergoing ablation and 17 978 patients managed with medical therapy. The time-at-risk was counted from the first medical therapy, and ablation was analysed as a time-varying exposure. Propensity score-matching was used to correct for differences between the groups. During a median follow-up of 52 months, compared with patients with medical therapy, ablated patients showed lower incidence and risk of overall dementia (8.1 and 5.6 per 1000 person-years, respectively; hazard ratio 0.73, 95% confidence interval 0.58-0.93). The associations between ablation and dementia risk were consistently observed after additionally censoring for incident stroke (hazard ratio 0.76, 95% confidence interval 0.61-0.95) and more pronounced in cases of ablation success whereas no significant differences observed in cases of ablation failure. Ablation was associated with lower risks of dementia subtypes including Alzheimer's disease and vascular dementia.In this nationwide cohort of AF patients treated with catheter ablation or medical therapy, ablation was associated with decreased dementia risk. This relationship was evident after censoring for stroke and adjusting for clinical confounders.