Abstract Background and Aims It remains unknown whether the brain glymphatic system, which is driven by the heartbeat-driven pulsation of arteries and is responsible for cerebral waste clearance, is impaired in atrial fibrillation (AF) and mediates cognitive dysfunction related to AF. The aim of this study was to assess brain glymphatic alterations in AF, their role in cognitive function, and whether catheter ablation can improve glymphatic activity. Methods In this case-control and prospective before–and–after study, patients with AF and healthy controls (HCs) were enrolled. Participants underwent brain magnetic resonance imaging and a comprehensive neuropsychological battery. Glymphatic activity was quantified by diffusion tensor image analysis along the perivascular space (DTI-ALPS) index. Magnetic resonance imaging was repeated after surgery in patients who underwent ablation. Results Overall, 87 patients with AF and 44 HCs were enrolled. Compared with HCs, patients with AF had a lower ALPS index (P = .016). Nonparoxysmal AF patients showed lower ALPS index than both HCs (P = .002) and paroxysmal AF patients (P = .044). A lower ALPS index was associated with worse scores of Trail Making Test, Digit Symbol Substitution Test, Digit Span Test, and Stroop Colour and Word Test (all P < .05). Mediation analyses revealed that glymphatic activity was a mediator between AF and cognitive decline. Among the 50 patients who underwent ablation therapy, DTI-ALPS index was improved after surgery (P = .015). Conclusions Brain glymphatic function measured by DTI-ALPS index was impaired in patients with AF, mediates the association between AF and cognitive decline, and was improved after ablation therapy.