Background Dual specificity protein phosphatase (DUSP)12 is an atypical member of the protein tyrosine phosphatase family, which are overexpressed in multiple types of malignant tumors. This protein family protect cells from apoptosis and promotes the proliferation and motility of cells. However, the pathological role of DUSP12 in hepatocellular carcinoma (HCC) is incompletely understood. Methods We analyzed mRNA expression of DUSP12 between HCC and normal liver tissues using multiple online databases, and explored the status of DUSP12 mutants using the cBioPortal database. The correlation between DUSP12 expression and tumor-infiltrating immune cells was demonstrated using the Tumor Immune Estimation Resource database and the Tumor and Immune System Interaction Database. Loss of function assay was utilized to evaluate the role of DUSP12 in HCC progression. Results DUSP12 had higher expression along with mRNA amplification in HCC tissues compared with those in normal liver tissues, which suggested that higher DUSP12 expression predicted shorter overall survival. Analyses of functional enrichment of differentially expressed genes suggested that DUSP12 regulated HCC tumorigenesis, and that knockdown of DUSP12 expression by short hairpin (sh)RNA decreased the proliferation and migration of HCC cells. Besides, DUSP12 expression was positively associated with the infiltration of cluster of differentiation (CD)4+ T cells (especially CD4+ regulatory T cells), macrophages, neutrophils and dendritic cells. DUSP12 expression was positively associated with immune-checkpoint moieties, and was downregulated in a C3 immune-subgroup of HCC (which had the longest survival). Conclusion These data suggest that DUSP12 may have a critical role in the tumorigenesis, infiltration of immune cells, and prognosis of HCC.