BackgroundImmune-related genes (IRGs) have been confirmed to play an important role in tumorigenesis and tumor microenvironment formation in hepatocellular carcinoma (HCC). We investigated how IRGs regulates the HCC immunophenotype and thus affects the prognosis and response to immunotherapy.MethodsWe investigated RNA expression of IRGs and developed an immune-related genes-based prognostic index (IRGPI) in HCC samples. Then, the influence of the IRGPI on the immune microenvironment was comprehensively analysed.ResultsAccording to IRGPI, HCC patients are divided into two immune subtypes. A high IRGPI was characterized by an increased tumor mutation burden (TMB) and a poor prognosis. More CD8 + tumor infiltrating cells and expression of PD-L1 were observed in low IRGPI subtypes. Two immunotherapy cohorts confirmed patients with low IRGPI demonstrated significant therapeutic benefits. Multiplex immunofluorescence staining determined that there were more CD8 + T cells infiltrating into tumor microenvironment in IRGPI-low groups, and the survival time of these patients was longer.ConclusionsThis study demonstrated that the IRGPI serve as a predictive prognostic biomarker and potential indicator for immunotherapy.