Background: Hepatocellular carcinoma (HCC) ranks the fourth in terms of cancer-related mortality globally. Herein, in this research, we attempted to develop a novel immune-related gene signature that could predict survival and e cacy of immunotherapy for HCC patients. Methods: The transcriptomic and clinical data of HCC samples were downloaded from The Cancer Genome Atlas (TCGA) and GSE14520 datasets, followed by acquisition of immune-related genes from the ImmPort database. Afterwards, an immune-related gene-based prognostic index (IRGPI) was constructed using the Least Absolute Shrinkage and Selection Operator (LASSO) regression model. Kaplan-Meier survival curves as well as time-dependent receiver operating characteristic (ROC) curve were performed to evaluate its predictive capability. Besides, both univariate and multivariate analysis on overall survival for the IRGPI and multiple clinicopathologic factors were carried out, followed by the construction of nomogram. Finally, we explored the possible correlation of IRGPI with immune cell in ltration or immunotherapy e cacy. Results: Analysis of 365 HCC samples identi ed 11 differentially expressed genes, which were selected to establish the IRGPI. Notably, it can predict survival of HCC patients more accurately than published biomarkers. Furthermore, IRGPI can predict the in ltration of immune cells in the tumor microenvironment of HCC, as well as the response of immunotherapy. Conclusion: Collectively, the currently established IRGPI can accurately predict survival, re ect the immune microenvironment, and predict the e cacy of immunotherapy among HCC patients.