Background: Aging is a well-studied concept, but no studies have comprehensively analyzed the association between aging-related genes (AGs) and hepatocellular carcinoma (HCC) prognosis.Methods: Gene candidates were selected from differentially expressed genes and prognostic genes in The Cancer Genome Atlas (TCGA) database. A gene risk score for overall survival prediction was established using the least absolute shrinkage and selection operator (LASSO) regression analysis, and this was validated using data from the International Cancer Genome Consortium (ICGC) database. Functional analysis was conducted using gene ontology enrichment, Kyoto Encyclopedia of Genes and Genomes analysis, gene set enrichment analysis, and immune microenvironment and tumor stemness analyses.Results: Initially, 72 AGs from the TCGA database were screened as differentially expressed between normal and tumor tissues and as genes associated with HCC prognosis. Then, seven AGs (POLA1, CDK1, SOCS2, HDAC1, MAPT, RAE1, and EEF1E1) were identified using the LASSO regression analysis. The seven AGs were used to develop a risk score in the training set, and the risk was validated to have a significant prognostic value in the ICGC set (p < 0.05). Patients with high risk scores had lower tumor differentiation, higher stage, and worse prognosis (all p < 0.05). Multivariate Cox regression analyses also confirmed that the risk score was an independent prognostic factor for HCC in both the TCGA and ICGC sets (all p < 0.05). Further analysis showed that a high risk score was correlated with the downregulation of metabolism and tumor immunity.Conclusion: The risk score predicts HCC prognosis and could thus be used as a biomarker not only for predicting HCC prognosis but also for deciding on treatment.