The number of older adults with cognitive impairment is increasing, and such adults often require a surrogate to make decisions about health care. However, little is known about the aggressiveness of end-of-life care for these people, especially those who reside in the community. We found that cognitive impairment is common among older adults approaching the end of life, whether they live in the community or in a nursing home, and that nearly 30 percent of patients with severe dementia remained in the community until death. Among those patients, having an advance directive in the form of a living will was associated with significantly less aggressive care at the end of life, compared to similar patients without an advance directive—as measured by Medicare spending ($11,461 less per patient), likelihood of in-hospital death (17.9 percentage points lower), and use of the intensive care unit (9.4 percentage points lower). In contrast, advance directives were not associated with differences in care for people with normal cognition or mild dementia, whether they resided in the community or in a nursing home. Timely advance care planning after a diagnosis of cognitive impairment may be particularly important for older adults who reside in the community.