Viruses drive carcinogenesis in human cancers through diverse mechanisms that have not been fully elucidated but include promoting immune escape. Here we investigated associations between virus-positivity and immune pathway alteration for 2009 tumors across six virus-related cancer types. Analysis revealed that for 3 of 72 human papillomavirus (HPV)-positive head and neck squamous cell carcinoma (HNSC) the HPV genome integrated in immune checkpoint genes PD-L1 or PD-L2, driving elevated expression in the corresponding gene. In addition to the previously described upregulation of the PD-1 immunosuppressive pathway in Epstein-Barr virus (EBV)-positive stomach tumors, we also observed upregulation of the PD-1 pathway in cytomegalovirus (CMV)-positive tumors. Furthermore, we found signatures of T-cell and B-cell response in HPV-positive HNSC and EBV-positive stomach tumors and HPV-positive HNSC patients were associated with better survival when T-cell signals were detected. Our work reveals that viral infection may recruit immune effector cells, and upregulate PD-1 and CTLA-4 immunosuppressive pathways.