It has been estimated that 15%-20% of human cancers are attributable to infections, mostly by carcinogenic viruses. The incidence varies worldwide, with a majority affecting developing countries. Here, we present a comparative analysis of virus-positive and virus-negative tumors in nine cancers linked to five viruses. We find that virus-positive tumors occur more frequently in males and show geographical disparities in incidence. Genomic analysis of 1,658 tumors reveals virus-positive tumors exhibit distinct mutation signatures and driver gene mutations and possess a lower somatic mutation burden compared to virus-negative tumors of the same cancer type. For example, compared to the respective virus-negative counterparts, virus-positive cases across different cancer histologies had less often mutations of TP53 and deletions of 9p21.3/CDKN2A-CDKN1A; Epstein-Barr virus-positive (EBV+) gastric cancer had more frequent mutations of EIF4A1 and ARID1A and less marked mismatch repair deficiency signatures; and EBV-positive cHL had fewer somatic genetic lesions of JAK-STAT, NF-κB, PI3K-AKT and HLA-I genes and a less pronounced activity of the aberrant somatic hypermutation signature. In cHL, we also identify germline homozygosity in HLA class I as a potential risk factor for the development of EBV-positive Hodgkin lymphoma. Finally, an analysis of clinical trials of PD-(L)1 inhibitors in four virus-associated cancers suggested an association of viral infection with higher response rate in patients receiving such treatments, which was particularly evident in gastric cancer and head and neck squamous cell carcinoma. These results illustrate the epidemiological, genetic, prognostic, and therapeutic trends across virus-associated malignancies.