Background: It is unclear whether HIV infection MESHD is associated with risk of COVID-19 death MESHD. We aimed to investigate this in a large-scale population-based study in England. Methods: Working on behalf of NHS England, we used the OpenSAFELY platform to analyse routinely collected electronic primary care data linked to national death MESHD registrations. People with a primary care record for HIV infection MESHD were compared to people without HIV. COVID-19 death MESHD was defined by ICD-10 codes U07.1 or U07.2 anywhere on the death MESHD certificate. Cox regression models were used to estimate the association between HIV infection MESHD and COVID-19 death MESHD, initially adjusted for age TRANS and sex, then adding adjustment for index of multiple deprivation and ethnicity, and finally for a broad range of comorbidities. Interaction terms were added to assess effect modification by age TRANS, sex, ethnicity, comorbidities and calendar time. Results: 17.3 million adults TRANS were included, of whom 27,480 (0.16%) had HIV recorded. People living with HIV were more likely to be male TRANS, of black ethnicity, and from a more deprived geographical area than the general population. There were 14,882 COVID-19 deaths MESHD during the study period, with 25 among people with HIV. People living with HIV had nearly three-fold higher risk of COVID-19 death MESHD than those without HIV after adjusting for age TRANS and sex (HR=2.90, 95% CI 1.96-4.30). The association was attenuated but risk remained substantially raised, after adjustment for deprivation and ethnicity (adjusted HR=2.52, 1.70-3.73) and further adjustment for comorbidities (HR=2.30, 1.55-3.41). There was some evidence that the association was larger among people of black ethnicity (HR = 3.80, 2.15-6.74, compared to 1.64, 0.92-2.90 in non-black individuals, p-interaction=0.045) Interpretation: HIV infection MESHD was associated with a markedly raised risk of COVID-19 death MESHD in a country with high levels of antiretroviral therapy coverage and viral suppression; the association was larger in people of black ethnicity.