The present study aimed to examine the molecular marker associated with the therapy and prognosis of hepatocellular carcinoma (HCC), and further investigate the association between its expression and the clinicopathological features of HCC. To select the core genes closely associated with HCC, differentially expressed genes (DEGs) were analyzed and screened from Gene Expression Omnibus datasets (GSE 36376) using a bioinformatics approach. Tumor and adjacent tissues were collected form 112 patients of HCC who were treated by radical resection. The expression levels of carbonic anhydrase II (CA2) in the tumor and adjacent tissues were determined using reverse transcription-quantitative polymerase chain reaction analysis and immunohistochemistry. The χ 2 test was applied for observing the association between the expression of CA2 and clinicopathological features of patients with HCC. The effects of the expression of CA2 on the patients' overall survival (OS) and disease-free survival (DFS) were examined via Kaplan-Meier analysis. A total of 83 DEGs were screened and analyzed using gene network analysis, among which CA2 had direct interactions with more than one disease gene of HCC. The results of immunohistochemistry showed that CA2 was expressed at a lower level in the tumor tissues compared with the adjacent tissues (t=3.012, P=0.010). Single factor analysis revealed that the mRNA expression of CA2 was able to predict the recurrence of HCC, and was significantly associated with α-fetoprotein (AFP), microvascular invasion, tumor-node-metastasis (TNM) staging, and recurrence (P<0.05). The expression levels of AFP, CA2 and TNM staging were confirmed to be independent prognostic factors of HCC (P<0.05). Kaplan-Meier analysis demonstrated that the group with a high expression of CA2 showed increased DFS and OS, compared with the low expression group (P<0.05). These findings indicated that elevated CA2 increased DFS and OS of HCC, which suggested that CA2 may be a potential target for HCC therapy.