Here, we identify the viral oncogenes of the DNA tumor viruses, including E7 from human papillomavirus (HPV) and E1A from adenovirus, as potent and specific inhibitors of the cGAS-STING pathway. We show that the LXCXE motif of these oncoproteins, which is essential for blockade of the Retinoblastoma tumor suppressor, is also important for cGAS-STING pathway antagonism. We find that E1A and E7 bind to STING, and that silencing of these oncogenes in human tumor cells restores cGAS-STING pathway signaling. Our findings reveal a host-virus conflict that may have shaped the evolution of viral oncogenes, with implications for the origins of the DNA viruses that cause cancer in humans.