Background: The role of atrial fibrillation in cognitive impairment and dementia, independent of stroke, is uncertain. We sought to determine the association of atrial fibrillation with cognitive and physical impairment in a large group of patients at high cardiovascular risk. Methods: We conducted a post-hoc analysis of two randomized controlled trials involving 31 546 patients, the aims of which were to evaluate the efficacy of treatment with ramipril plus telmisartan (ONTARGET) or telmisartan alone (TRANSCEND) in reducing cardiovascular disease. We evaluated the cognitive function of participants at baseline and after two and five years using the Mini-Mental State Examination (MMSE). In addition, we recorded incident dementia, loss of independence in activities of daily living and admission to long-term care facilities. We used a Cox regression model adjusting for main confounders to determine the association between atrial fibrillation and our primary outcomes: a decrease of three or more points in MMSE score, incident dementia, loss of independence in performing activities of daily living and admission to long-term care. Results: We enrolled 31 506 participants for whom complete information on atrial fibrillation was available, 70.4% of whom were men. The mean age of participants was 66.5 years, and the mean baseline MMSE score was 27.7 (standard deviation 2.9) points. At baseline, 1016 participants (3.3%) had atrial fibrillation, with the condition developing in an additional 2052 participants (6.5%) during a median follow-up of 56 months. Atrial fibrillation was associated with an increased risk of cognitive decline (hazard ratio [HR] 1.14, 95% confidence interval [CI] 1.03-1.26), new dementia (HR 1.30, 95% CI 1.14-1.49), loss of independence in performing activities of daily living (HR 1.35, 95% CI 1.19-1.54) and admission to long-term care facilities (HR 1.53, 95% CI 1.31-1.79). Results were consistent among participants with and without stroke or receiving antihypertensive drugs. Interpretation: Cognitive and functional de - cline are important consequences of atrial fibrillation, even in the absence of overt stroke.