The impact of cancer on outcome of persons with coronavirus disease 2019 (COVID-19) after infection with acute respiratory syndrome coronavirus-2 (SARS-CoV-2) is controversial. We studied 1859 subjects with COVID-19 from seven centers in Wuhan, China, 65 of whom had cancer. We found having cancer was an independent risk factor for in-hospital death from COVID-19 in persons <65 years (hazard ratio [HR] = 2.45, 95% confidence interval [CI], 1.04, 5.76; P = 0.041) but not in those ≥65 years (HR = 1.12 [0.56, 2.24]; P = 0.740). It was also more common in those not in complete remission. Risks of in-hospital death were similar in subjects with solid cancers and those with hematological cancers. These data may help predict outcomes of persons with cancer and COVID-19.