The number of patients with hepatocellular carcinoma (HCC) caused by hepatitis B virus (HBV) infection remains large, despite the remarkable effectiveness of antiviral drugs and vaccines for HBV in preventing and treating HBV infection. Necroptosis is closely related to the occurrence of inflammation, clearance of viral infection, and tumor progression. Presently, little is known about the changes in necroptosis-related genes in the progression from chronic HBV infection (CHI) to HBV-related hepatic fibrosis (HBV-HF) and HBV-related hepatocellular carcinoma (HBV-HCC). In this study, Cox regression analysis was performed using GSE14520 chip data and a necroptosis-related genes survival prognosis score (NRGPS) was established for HBV-HCC patients. NRGPS was constructed using three model genes (G6PD, PINK1 and LGALS3), and verified by data sequencing in the TCGA database. The HBV-HCC cell model was established by transfection of pAAV/HBV1.2C2, constructed by homologous recombination, into HUH7 and HEPG2 cells. The expression levels of G6PD, PINK1, and LGALS3 were detected using RT-qPCR. We further analyzed the expression of the model genes in GSE83148, GSE84044, and GSE14520 and found that LGALS3 was consistently highly expressed in CHI, high fibrosis score and high NRGPS. In addition, immune microenvironment analysis showed that LGALS3 was not only associated with the infiltration of regulatory T cells in the immune microenvironment but also with expression of CCL20 and CCR6. The expression levels of model genes, FOXP3 and CCR6, were analyzed using RT-qPCR in peripheral blood mononuclear cells of 31 hepatitis B surface antibody positive patients, 30 CHI, 21 HBV-HF, and 20 HBV-HCC. In further cell-model experiments, we analyzed the expression of CCL20 by RT-qPCR and the changes in cell proliferation and migration by CCK8 and transwell assays, respectively, in HBV-HCC cell models after LGALS3 knockdown. The findings of this study suggest that LGALS3 could be a biomarker for adverse progression following chronic HBV infection and may also be involved in the regulation of the immune microenvironment, making it a potential therapeutic target.