Hepatocellular carcinoma (HCC) is a common malignancy associated with high morbidity and mortality rates worldwide. To improve the prognosis of HCC, early diagnosis is crucial. However, to date, little is known about the role of natural killer cell-related genes (NKCRGs) in predicting the prognosis of hepatocellular carcinoma patients. In this study, we identified 24 differentially expressed NKCRGs in HCC specimens from the TCGA dataset, including 22 upregulated genes and 2 downregulated genes. Functional enrichment analysis revealed that these genes were mainly involved in immune response pathways and various cancer-related pathways. Univariate analysis identified 21 prognostic NKCRGs, with eight genes (PAK1, MAP2K2, MAPK3, PLCG1, SHC1, HRAS, NRAS, and MICB) confirmed to be involved in HCC prognosis through Venn diagram analysis. A prognostic model was developed using LASSO-Cox regression, incorporating four genes (MAP2K2, SHC1, HRAS, and NRAS). The model's risk score was significantly associated with overall survival (OS) in both the TCGA and ICGC cohorts. Patients with high-risk scores had poorer OS, as demonstrated by Kaplan-Meier curves and ROC analyses. The risk score was not significantly correlated with gender or age but was higher in patients with advanced tumor grades and stages. Immune status analysis using ssGSEA showed higher enrichment scores for various immune cells and pathways in the high-risk group. Additionally, the risk score was positively correlated with the immune score, indicating its potential role in tumor microenvironment modulation. Expression analysis revealed that HRAS, SHC1, MAP2K2, and NRAS were upregulated in HCC tissues, with higher expressions of HRAS, MAP2K2, and NRAS associated with shorter OS. Knockdown experiments confirmed that silencing NRAS suppressed the proliferation of HCC cells, highlighting its potential as a therapeutic target. Overall, our findings suggest that the identified NKCRGs, particularly NRAS, play crucial roles in HCC progression and could serve as valuable prognostic markers and therapeutic targets.