Background: Given the fact that viral infections play an important role, either directly or indirectly, in around 20 percent of human cancers, this study aimed at investigating the potential association of Epstein–Barr virus (EBV) and cytomegalovirus (CMV) infections in esophageal cancer that is the sixth most common cause of cancer-related deaths. Methods: In this case-control study, a total of 200 paraffin-embedded biopsies of cancerous and benign esophageal tissues were gathered from the biopsy bank of Imam Reza Hospital, Tabriz, Iran in 2017. All samples were first deparaffinized, and then subjected to commercial DNA extraction. The quality of extracted DNA was evaluated by amplification of the beta globulin gene. Identification of EBV and CMV DNA was performed using primers designed for the EBER region of EBV and the immediate early (IE) region of the CMV genome, respectively. Results: The mean age of the subjects in the test and control groups was 52.2 (17.1) and 59.9 (18.9), respectively. The distribution of gender (male/female) in patient and control groups was 54/46 and 53/47, respectively. Our results showed that the frequency of EBV (P < 0.001) and CMV (P < 0.001) in cancerous samples was statistically higher than control group. Moreover, in the cancerous group the rate of EBV was significantly higher in the esophageal adenocarcinomas (EAC) sample (12 out of 70) than esophageal squamous cell carcinomas (ESCC) (0 out of 30) (P = 0.016) but, in the ESCC group, 17 out of 30 subjects were positive for CMV which was significantly higher in comparison with EAC patients (1 out of 70) (P < 0.001). Conclusions: Findings indicated that EBV and CMV might be contributed to the pathogenesis of EAC and ESCC types of esophageal carcinoma, respectively, although further studies are warranted.