Physicians have an ethical obligation to honor patients' values for care, including at the end of life (EOL). We sought to evaluate factors that help patients to receive care consistent with their preferences. This was a longitudinal multi-institutional cohort study. We measured baseline preferences for life-extending versus symptom-directed care and actual EOL care received in 325 patients with advanced cancer. We also measured associated sociodemographic, health, and communication characteristics, including EOL discussions between patients and physicians. Preferences were assessed a median of 125 days before death. Overall, 68% of patients (220 of 325 patients) received EOL care consistent with baseline preferences. The proportion was slightly higher among patients who recognized they were terminally ill (74%, 90 of 121 patients; P = .05). Patients who recognized their terminal illness were more likely to prefer symptom-directed care (83%, 100 of 121 patients; v 66%, 127 of 191 patients; P = .003). However, some patients who were aware they were terminally ill wished to receive life-extending care (17%, 21 of 121 patients). Patients who reported having discussed their wishes for EOL care with a physician (39%, 125 of 322 patients) were more likely to receive care that was consistent with their preferences, both in the full sample (odds ratio [OR] = 2.26; P < .0001) and among patients who were aware they were terminally ill (OR = 3.94; P = .0005). Among patients who received no life-extending measures, physical distress was lower (mean score, 3.1 v 4.1; P = .03) among patients for whom such care was consistent with preferences. Patients with cancer are more likely to receive EOL care that is consistent with their preferences when they have had the opportunity to discuss their wishes for EOL care with a physician.