Background: DNA damage repair (DDR) is an important mechanism for the occurrence and development of hepatocellular carcinoma (HCC), but its impact on prognosis has not been fully understood.Materials and methods: A total of 904 HCC patients were included in our study, TCGA (n = 370) and GSE14520 (n = 239) were merged into a large-sample training cohort (n = 609). The training cohort was clustered into C1 and C2 based on prognostic DDR-related genes, the differentially expressed genes (DEGs) between C1 and C2 were identified by the Wilcoxon signed-rank test referred to criteria (|log2FC|â„1 and FDR< 0.05). The univariate Cox analysis was used to screen the prognostic-related DEGs, and Lasso penalized Cox regression analysis was used to construct the risk score. The patients were clarified into high- and low-risk groups based on the median risk score. ICGC (n = 231) and GSE116174 (n = 64) cohorts were used for external validation of the risk scoreâs prognostic value.Results: The KaplanâMeier survival analysis showed that the high-risk group had a significantly reduced overall survival (OS) compared to the low-risk group in the three independent cohorts, and the time-dependent ROC curve showed that the five-gene (STMN1, PON1, PLOD2, MARCKSL1, and SPP1) risk score with a high accuracy in predicting OS. The patients with AFP >300Â ng/ml, tumor poor differentiation (grade 3â4), micro and macro vascular tumor invasion, advanced stage (AJCC III-IV, BCLC stage B-C, and CLIP score >2) exhibited a higher risk score. Subgroup survival analysis found that the risk score was applicable to patients with different clinical characteristics. GO and KEGG functional enrichment analysis revealed that cell cycle, p53 signaling, TNF signaling-related pathways were upregulated in the high-risk group. The higher infiltration level of activated CD4 T cell, CD56 bright natural killer cell, plasmacytoid dendritic cell, and type 2Â T helper cells were found to lead an unfavorable impact on the OS of HCC patients, and these four kinds of immune cells exhibited a higher infiltration level in the high-risk group.Conclusion: The five-gene risk score proposed in the research may provide new insights into the individualized evaluation of HCC prognosis.