BACKGROUND: There is mixed evidence about the relations of current versus past cancer with severe COVID-19 outcomes and how they vary by patient and cancer characteristics. METHODS: Electronic health record data of 104,590 adult hospitalized patients with COVID-19 were obtained from 21 United States health systems from February 2020 through September 2021. In-hospital mortality and ICU admission were predicted from current and past cancer diagnoses. Moderation by patient characteristics, vaccination status, cancer type, and year of the pandemic was examined. RESULTS: 6.8% of the patients had current (n = 7,141) and 6.5% had past (n = 6,749) cancer diagnoses. Current cancer predicted both severe outcomes but past cancer did not; adjusted odds ratios (aOR) for mortality were 1.58 [95% confidence interval (CI), 1.46-1.70] and 1.04 (95% CI, 0.96-1.13), respectively. Mortality rates decreased over the pandemic but the incremental risk of current cancer persisted, with the increment being larger among younger vs. older patients. Prior COVID-19 vaccination reduced mortality generally and among those with current cancer (aOR, 0.69; 95% CI, 0.53-0.90). CONCLUSIONS: Current cancer, especially among younger patients, posed a substantially increased risk for death and ICU admission among patients with COVID-19; prior COVID-19 vaccination mitigated the risk associated with current cancer. Past history of cancer was not associated with higher risks for severe COVID-19 outcomes for most cancer types. IMPACT: This study clarifies the characteristics that modify the risk associated with cancer on severe COVID-19 outcomes across the first 20 months of the COVID-19 pandemic. See related commentary by Egan et al., p. 3.