Hepatocellular carcinoma (HCC) is one of the most malignant types of cancer, and is associated with high recurrence rates and a poor response to chemotherapy. Immune signatures in the microenvironment of HCC have not been well explored systematically. The aim of the present study was to identify prognostic immune signatures and build a nomogram for use in clinical evaluation. Using bioinformatics analysis, RNA-seq data and overall survival (OS) information on 370 HCC cases from TCGA and 232 HCC cases from ICGC were analyzed. The differential expression of select immune genes, based on previously published studies, between HCC and adjacent tissue were analyzed using the limma package in R. Enrichment of pathways and gene ontology analysis was performed using clusterProfiler. Subsequently, univariate Cox regression analysis, Lasso penalty linear regression and multivariate Cox regression models were used to construct a model for immune risk score (IRS). The R packages, survival and survivalROC, were used to plot survival and the associated receiver operating characteristic curves. Infiltration of immune cells was calculated using Tumor IMmune Estimation Resource, with significance examined using a Pearson's correlation test. P<0.05 was considered significant. Based on the analysis, expression of 200 immune genes were upregulated and 47 immune genes were downregulated immune genes. In the multivariate Cox model, 5 genes (enhancer of zest homology 2, ferritin light chain, complement factor H related 3, isthmin 2, cyclin dependent kinase 5) were used to generate the IRS. By stratifying according to the median IRS, it was shown that patients with a high IRS had poor OS rates after 1, 2, 3 and 5 years, and this result was consistent across the testing, training and independent validation cohorts. Additionally, the IRS was correlated with the abundance of infiltrating immune cells. The nomogram built using IRS and clinical characteristics, was able to predict 1, 3 and 5 year OS with area under the curve values of >0.8. These results suggest that the model developed to calculate the IRS may be used to monitor the effectiveness of treatment strategies and for prognostic prediction.