Background Patients with schizophrenia represent a vulnerable, underserved, and undertreated population who have been neglected in health disparities work. Understanding of end-of-life care in patients with schizophrenia and cancer is poor. We aimed to establish whether end-of-life care delivered to patients with schizophrenia and cancer differed from that delivered to patients with cancer who do not have diagnosed mental illness. Methods We did a population-based cohort study of all patients older than 15 years who had a diagnosis of advanced cancer and who died in hospital in France between Jan 1, 2013, and Dec 31, 2016. We divided this population into cases (ie, patients with schizophrenia) and controls (ie, patients without a diagnosis of mental illness) and compared access to palliative care and indicators of high-intensity end-of-life care between groups. In addition to unmatched analyses, we also did matched analyses (matched in terms of age at death, sex, and site of primary cancer) between patients with schizophrenia and matched controls (1:4). Multivariable generalised linear models were done with adjustment for social deprivation, year of death, time from cancer diagnosis to death, metastases, comorbidity, and hospital type (ie, specialist cancer centre vs non-specialist centre). Findings The main analysis included 2481 patients with schizophrenia and 222 477 controls. The matched analyses included 2477 patients with schizophrenia and 9896 controls. Patients with schizophrenia were more likely to receive palliative care in the last 31 days of life (adjusted odds ratio 1•61 [95% CI 1•45-1•80]; p<0•0001) and less likely to receive high-intensity end-of-life care-such as chemotherapy and surgery-than were matched controls without a diagnosis of mental illness. Patients with schizophrenia were also more likely to die younger, had a shorter duration between cancer diagnosis and death, and were more likely to have thoracic cancers and comorbidities than were controls. Interpretation Our findings suggest the existence of disparities in health and health care between patients with schizophrenia and patients without a diagnosis of mental illness. These findings underscore the need for better understanding of health inequalities so that effective interventions can be developed for this vulnerable population.