Importance: Epidemiological evidence suggests that physical activity benefits cognition, but results from randomized trials are limited and mixed. Objective: To determine whether a 24-month physical activity program results in better cognitive function, lower risk of mild cognitive impairment (MCI) or dementia, or both, compared with a health education program. Design, Setting, and Participants: A randomized clinical trial, the Lifestyle Interventions and Independence for Elders (LIFE) study, enrolled 1635 community-living participants at 8 US centers from February 2010 until December 2011. Participants were sedentary adults aged 70 to 89 years who were at risk for mobility disability but able to walk 400 m. Interventions: A structured, moderate-intensity physical activity program (n = 818) that included walking, resistance training, and flexibility exercises or a health education program (n = 817) of educational workshops and upper-extremity stretching. Main Outcomes and Measures: Prespecified secondary outcomes of the LIFE study included cognitive function measured by the Digit Symbol Coding (DSC) task subtest of the Wechsler Adult Intelligence Scale (score range: 0-133; higher scores indicate better function) and the revised Hopkins Verbal Learning Test (HVLT-R; 12-item word list recall task) assessed in 1476 participants (90.3%). Tertiary outcomes included global and executive cognitive function and incident MCI or dementia at 24 months. Results: At 24 months, DSC task and HVLT-R scores (adjusted for clinic site, sex, and baseline values) were not different between groups. The mean DSC task scores were 46.26 points for the physical activity group vs 46.28 for the health education group (mean difference, -0.01 points [95%CI, -0.80 to 0.77 points], P = .97). The mean HVLT-R delayed recall scores were 7.22 for the physical activity group vs 7.25 for the health education group (mean difference, -0.03 words [95%CI, -0.29 to 0.24 words], P = .84). No differences for any other cognitive or composite measures were observed. Participants in the physical activity group who were 80 years or older (n = 307) and those with poorer baseline physical performance (n = 328) had better changes in executive function composite scores compared with the health education group (P = .01 for interaction for both comparisons). Incident MCI or dementia occurred in 98 participants (13.2%) in the physical activity group and 91 participants (12.1%) in the health education group (odds ratio, 1.08 [95%CI, 0.80 to 1.46]). Conclusions and Relevance: Among sedentary older adults, a 24-month moderate-intensity physical activity program compared with a health education program did not result in improvements in global or domain-specific cognitive function.