Chronic hepatitis B virus (HBV) is the leading cause of hepatocellular carcinoma (HCC). Covalently closed circular DNA (cccDNA) is an intermediate in the life cycle of HBV. HBV-encoded X protein (HBx), a key viral oncoprotein, can be specifically ubiquitylated by male specific lethal 2 (MSL2), which causes upregulation of HBx activity and promotes transcription, cell proliferation and tumor growth. The present study compared the levels of cccDNA, MSL2 mRNA and HBx mRNA in tumor and peri-tumor tissues, and clarified the effect of antiviral therapy on these indicators. Levels of intrahepatic cccDNA, MSL2 mRNA and HBx mRNA were determined using quantitative PCR in patients with HBV-associated HCC who had undergone liver surgery. A total of 50 patients were included in the present study. Prior to surgery, 31 patients had undergone antiviral treatment. Intrahepatic cccDNA levels were significantly higher in the tumor tissues compared with the peri-tumor tissues (P= 0.001), particularly in the hepatitis B e antigen-positive (P= 0.008), tumor recurrence (P= 0.002) and <3 cm tumor size (P= 0.003) groups. Furthermore, in patients with preoperative cirrhosis, levels of cccDNA and MSL2 mRNA were significantly higher in tumor tissues compared with that in peri-tumor tissues (P<0.001 and P= 0.023, respectively). The expression levels of HBx mRNA in antiviral-treated tumors and peri-tumor tissues were significantly lower compared with those in untreated tissues (P= 0.026 and P= 0.035). The levels of cccDNA and MSL2 mRNA in the HBx-positive group were significantly higher in tumor tissues compared with those in peri-tumor tissues (P= 0.026 and P= 0.013). In conclusion, cccDNA participated in the tumorigenesis of HBV-associated HCC, and antiviral therapy was found to modulate hepatocarcinogenesis by decreasing the levels of HBx to inhibit the tumorigenic effect of MSL2 and cccDNA.