Background: Hepatitis B virus (HBV) is still the leading cause of hepatocellular carcinoma (HCC). HBV could persist in the low replicate state that is defines as occult hepatitis B virus infection (OBI). Recently, OBI has been defined important in the development and/or exacerbation of HCC and other liver diseases. Objectives: This study tried to determine the frequency of OBI among liver tumor samples. Methods: This cross-sectional study was performed among patients with HCC and intrahepatic cholangiocarcinoma (iCCA) in hospitals affiliated with Iran University of Medical Sciences. Liver tumor samples (Fresh frozen and formalin fixed paraffin embedded) were processed for isolation of DNA and then subjected to molecular assays, including PCR examinations of HBV genes (S, X, and C), determination of viral loads, detection of HBV-cccDNA, phylogenetic analysis, and assessment of mutations in HBsAg and RT regions. Results: In total, there were 93 participants, including HCC (n = 60), iCCA (n = 33); among which, 15% were detected positive for OBI. The OBI among HCC and iCCA were 18.3% and 9.1%, respectively. The mean intrahepatic viral load was 1.3 × 105 ± 1.4 × 102 copies/µl, and 5 had detectable cccDNA. The OBI subjects belonged to the HBV genotype D and subgenotype D1. In the HBsAg protein, T45N (33.3%) and P105A (25%) were the most prevalent mutations. N53K (33.3%), Y54H (25%), L80I (33.3%), and A113G (25%) were missense mutations that were observed in the RT domain. Conclusions: HBV-DNA was detected among liver tumor samples with negative HBsAg status. The results of viral load and cccDNA tests are important in identification and prognosis of liver diseases. It’s needed more precise molecular and cohort studies to clarify the functions of OBI in liver diseases.