People living with HIV (PLHIV) are more likely than the general population to develop AIDS‐defining malignancies (ADMs) and several non‐ADMs (NADMs). Information is lacking on survival outcomes and cause‐specific mortality after cancer diagnosis among PLHIV. We investigated causes of death within 5 years of cancer diagnosis in PLHIV enrolled in European and North American HIV cohorts starting antiretroviral therapy (ART) 1996–2015, aged ≥16 years, and subsequently diagnosed with cancer. Cancers were grouped: ADMs, viral NADMs and nonviral NADMs. We calculated cause‐specific mortality rates (MR) after diagnosis of specific cancers and compared 5‐year survival with the UK and France general populations. Among 83,856 PLHIV there were 4,436 cancer diagnoses. Of 603 deaths after ADM diagnosis, 292 (48%) were due to an ADM. There were 467/847 (55%) and 74/189 (39%) deaths that were due to an NADM after nonviral and viral NADM diagnoses, respectively. MR were higher for diagnoses between 1996 and 2005 versus 2006–2015: ADMs 102 (95% CI 92–113) per 1,000 years versus 88 (78–100), viral NADMs 134 (106–169) versus 111 (93–133) and nonviral NADMs 264 (232–300) versus 226 (206–248). Estimated 5‐year survival for PLHIV diagnosed with liver (29% [19–39%]), lung (18% [13–23%]) and cervical (75% [63–84%]) cancer was similar to general populations. Survival after Hodgkin's lymphoma diagnosis was lower in PLHIV (75% [67–81%]). Among ART‐treated PLHIV diagnosed with cancer, MR and causes of death varied by cancer type, with mortality highest for liver and lung cancers. Deaths within 5 years of NADM diagnoses were more likely to be from cancer than AIDS.