Chronic hepatitis B virus (HBV) infection is the primary risk factor for the malignant progression of hepatocellular carcinoma (HCC). It has been reported that HBV X protein (HBx) possesses oncogenic properties, promoting hepatocarcinogenesis and chemoresistance. However, the detailed molecular mechanisms are not fully understood. Here, we aim to investigate the effects of miR-128-3p/SPG21 axis on HBx-induced hepatocarcinogenesis and chemoresistance. The expression of SPG21 in HCC was determined using bioinformatics analysis, quantitative real-time PCR (qRT-PCR), western blotting, and immunohistochemistry (IHC). The roles of SPG21 in HCC were elucidated through a series of in vitro and in vivo experiments, including real-time cellular analysis (RTCA), matrigel invasion assay, and xenograft mouse model. Pharmacologic treatment and flow cytometry were performed to demonstrate the potential mechanism of SPG21 in HCC. SPG21 expression was elevated in HCC tissues compared to adjacent non-tumor tissues (NTs). Moreover, higher SPG21 expression correlated with poor overall survival. Functional assays revealed that SPG21 fostered HCC tumorigenesis and invasion. MiR-128-3p, which targeted SPG21, was downregulated in HCC tissues. Subsequent analyses showed that HBx amplified TRPM7-mediated calcium influx via miR-128-3p/SPG21, thereby activating the c-Jun N-terminal kinase (JNK) pathway. Furthermore, HBx inhibited doxorubicin-induced apoptosis by engaging the JNK pathway through miR-128-3p/SPG21. The study suggested that SPG21, targeted by miR-128-3p, might be involved in enhancing HBx-induced carcinogenesis and doxorubicin resistance in HCC via the TRPM7/Ca2+/JNK signaling pathway. This insight suggested that SPG21 could be recognized as a potential oncogene, offering a novel perspective on its role as a prognostic factor and a therapeutic target in the context of HCC.