Background: Severe mental illness (SMI) is associated with poorer physical health, however the relationship between SMI and cancer is complex and previous study findings are inconsistent. Low incidence of cancer in those with SMI has been attributed to premature mortality, though evidence for this is lacking. We aimed to investigate the relationship between SMI and cancer incidence and mortality, and to assess the effect of premature mortality on cancer incidence rates. / Methods: In this UK-wide matched cohort study using primary care records we calculated incidence and mortality rates of all-cancer, and bowel, lung, breast or prostate cancer, in patients with SMI, compared to matched patients without SMI. We used competing risks regression to account for mortality from other causes. / Findings: 69,632 patients had an SMI diagnosis. The rate of all-cancer diagnoses was reduced in those with SMI (Hazard ratio (HR):0·95; 95%CI 0·93–0·98) compared to those without SMI, and particularly in those with schizophrenia (HR:0·82; 95%CI 0·77–0·88) compared to those without SMI. When accounting for the competing risk of premature mortality, incidence remained lower only in patients with schizophrenia. All-cause mortality after cancer was increased in the SMI group, and cancer-specific mortality was increased in those with schizophrenia (hazard ratio: 1.96; 95%CI 1.57–2.44). / Interpretation: Patients with schizophrenia have lower rates of cancer diagnosis but higher all-cause and cancer-specific mortality rates following diagnosis compared to those without SMI. Premature mortality does not explain these differences, suggesting the findings reflect barriers to cancer diagnosis and treatment, which need to be identified and addressed