The Toll-like receptor plays an essential role in controlling immunity and inflammation. This study was to investigate the relationships of genetic variants in TLR2 and TLR3 with hepatitis B virus (HBV) natural clearance and HBV-related hepatocellular carcinoma (HCC) risk in a Chinese male population. We analyzed 5 polymorphisms of TLR2 (rs3804099 and rs3804100) and TLR3 (rs5743305, rs3775296 and rs3775291) in a population consisting of 686 participants with HBV natural clearance, 293 chronic HBV carriers and 395 HBV-positive HCC patients, using the improved multiplex ligase detection reaction method. After adjustment for age and smoking and drinking status, no associations were observed either between the 5 single-nucleotide polymorphisms (SNPs) and the HBV natural clearance participants, or between the 5 SNPs and HCC patients. Whereas the stratified analysis showed that under the dominant models, nondrinkers with TLR2 rs3804100 and participants younger than 40 years old with TLR3 rs3775291 were significantly associated with HCC risk when compared with persistent HBV carriers (adjusted odd ratio [OR] = 0.49, 95% confidence interval [95% CI], 0.31-0.78, p = 0.003; and adjusted OR = 0.50, 95% CI, 0.29-0.86, p = 0.013, respectively). Furthermore, the TTTCT haplotype was found to promote the progress of HBV clearance and inhibit development of HBV-related HCC (OR = 0.77, 95% CI, 0.61-0.97, p = 0.029; and OR = 0.72, 95% CI, 0.55-0.94, p = 0.016, respectively). And the CCACC and CCTCT haplotypes were observed to decrease susceptibility to HCC (OR = 0.64, 95% CI, 0.40-1.00, p = 0.048; and OR = 0.43, 95% CI, 0.28-0.68, p<0.001, respectively). This study revealed that TLR2 rs3804100 and TLR3 rs3775291 polymorphisms may be protective factors for HBV-related HCC.