Background: Infertility is a global problem that affects more than 15% of couples. The occurrence of this problem is about 50% in males. Viral infections cause infertility in men by different mechanisms. Objectives: This study is designed to evaluate the effects of hepatitis B virus (HBV) and cytomegalovirus (CMV) infection on male fertility and determine the mechanisms involved. Methods: A total of 73 males were included in the present study. They were assigned to the groups healthy fertile (n = 22 volunteers) as the healthy controls, non-infected infertile (n = 27), HBV-infected infertile (n = 14), and CMV-infected infertile (n = 10). The sperm parameters, including count, morphology, progressive motility (PR), and progressive + non-progressive motility (PR + NP), were analyzed in their semen. The semen samples of all studied participants were subjected to polymerase chain reaction to determine the presence of HBV or CMV infection. Mitochondrial membrane potential (MMP) and tumor necrosis factor-alpha (TNF-α) were also assessed. Results: Our findings showed that all sperm parameters, including count, morphology, PR, and PR + NP, decreased in males with HBV and CMV infections compared to the healthy control group (P < 0.01 in all cases). MMP declined in HBV- and CMV-infected males compared to the healthy control group (P < 0.001). Conversely, the TNF-α level of semen in HBV- and CMV-infected men was significantly higher than in the healthy control group (P < 0.001). Conclusions: The results of the present study demonstrated that HBV and CMV infections lead to male infertility through increasing TNF-α and decreasing sperm MMP.