Although cancer has been associated with COVID-19 risk and mortality in hospital-based studies, few population-based studies have been reported. Utilizing data from the UK Biobank (UKB), a population-based prospective cohort, we formally tested the association of over 44 different types of cancer with COVID-19 infection MESHD and mortality among 7,661 subjects who were tested by June 17, 2020. Compared to non-cancer subjects, cancer subjects (N=1,521) had significantly lower overall risk for COVID-19 infection MESHD [odds ratio (OR) and 95% confidence interval (CI): 0.79 (0.68-0.92), P=2.60E-03]. However, a trend of higher risk for COVID-19 mortality was found among 256 COVID-19 positive cancer patients, especially for hematologic cancers such as non-Hodgkin lymphoma MESHD non-Hodgkin lymphoma HP [3.82 (1.17-12.01), P=0.02]. In cancer patients, while few demographic, lifestyle, genetic and comorbidity factors predicted risk for COVID-19 infection MESHD, older age TRANS, male TRANS sex, heart disease MESHD and hypertension MESHD hypertension HP significantly predicted COVID-19 mortality. The lower risk for COVID-19 infection MESHD is likely due to extra caution in COVID-19 prevention and more testing among cancer patients, an encouraging finding that demonstrates the feasibility of intervention. These results, if confirmed in future releases of UKB data and other independent populations, may provide guidance for COVID-19 prevention and treatment among cancer patients.