Inferferon-gamma (LFN-γ) exerts anti-tumor effects, but there is currently no reliable and comprehensive study on prognostic function of IFN-γ-related genes in liver cancer. In this study, IFN-γ-related differentially expressed genes (DEGs) in liver cancer were identified through GO/KEGG databases and open-access literature. Based on these genes, individuals with liver cancer were clustered. A prognostic model was built based on the intersection genes between differential genes in clusters and in liver cancer. Then, model predictive performance was analyzed and validated in GEO dataset. Regression analysis was fulfilled on the model, and a nomogram was utilized to evaluate model ability as an independent prognostic factor and its clinical application value. An immune-related analysis was conducted on both the H- and L-groups, with an additional investigation into link of model genes to drug sensitivity. Significant differential expression of IFN-γ-related genes was observed between the liver cancer and control groups. Subsequently, individuals with liver cancer were classified into two subtypes based on these genes, which displayed a notable difference in survival between the two subtypes. A 10-gene liver cancer prognostic model was constructed, with good prognostic performance and was an independent prognosticator for patient analysis. L-group patients possessed higher immune infiltration levels, immune checkpoint expression levels, and immunophenoscore, as well as lower TIDE scores. Drugs that had high correlations with the feature genes included SPANXB1: PF-04217903, SGX-523, MMP1: PF-04217903, DUSP13: Imatinib, TFF1: KHK-Indazole, and Fulvestrant. We built a 10-gene liver cancer prognostic model. It was found that L-group patients were more suitable for immunotherapy. This study provided valuable information on the prognosis of liver cancer.