Introduction: Atrial fibrillation (AF) has been associated with neurocognitive impairment. The broad effects of AF on the brain, however, remain to be clarified. We investigated using data from the UK Biobank (UKB) whether an automated electrocardiography (ECG) diagnosis of AF or atrial flutter (AFL) is associated with imaging-based markers of brain atrophy, including volume, thickness, and white matter microstructure, in brain regions associated with Alzheimer Disease (AD). Methods: We studied a subset of 48,705 UKB study participants with available brain magnetic resonance imaging (MRI) and cognitive function test data. AF/AFL were determined by either automatic ECG interpretation or history by self-reported and hospital-visit derived data. Participants were classified into four groups: 1) no history or ECG detection of AF/AFL; 2) history of AF/AFL but no AF/AFL on ECG; 3) no history of AF/AFL but AF/AFL on ECG; and 4) history of AF/AFL and AF/AFL on ECG. The following brain MRI measurements were obtained: mean bilateral hippocampal volume, fornix fractional anisotropy (FA), and an AD cortical thickness signature. The AD cortical thickness signature was computed as the average of thickness values in various frontal and temporal cortices involved in AD progression. Results: A total of 17,723 participants aged 46-81 (mean age 64 years, 52.2% female) with group sizes of 17182, 307, 100, and 134 (groups 1-4 respectively) were included. Compared to participants with no AF/AFL (group 1), hippocampal volume was significantly smaller in the two groups with AF/AFL on ECG (groups 3 and 4; 97.5 and 95.8 mm 3 smaller; p<0.005). No difference in the volume was found between groups 1 and 2. This pattern of group differences was similar for both fornix FA and the AD cortical thickness signature. A post-hoc analysis for the cognitive function variables showed that scores on the matrix pattern and symbol digit substitution cognitive tests were lower for participants with AF/AFL on ECG (groups 3+4) than those without AF/AFL (groups 1), each with a beta estimate of -0.16 standard deviations (p<0.05). Conclusion: AF/AFL on ECG at time of brain imaging, but not AF/AFL history, is associated with brain atrophy and disrupted white matter microstructure in AD-associated regions.