The Transforming Growth Factor-Beta (TGF-β) signaling pathway plays a crucial role in the pathogenesis of diseases. This study aimed to identify differentially expressed TGF-β-related genes in liver cancer patients and to correlate these findings with clinical features and immune signatures. The TCGA-STAD and LIRI-JP cohorts were utilized for a comprehensive analysis of TGF-β- related genes. Differential gene expression, functional enrichment, survival analysis, and machine learning techniques were employed to develop a prognostic model based on a TGF-β-related gene signature (TGFBRS). We developed a prognostic model for liver cancer based on the expression levels of nine TGF-β- related genes. The model indicates that higher TGFBRS values are associated with poorer prognosis, higher tumor grades, more advanced pathological stages, and resistance to chemotherapy. Additionally, the TGFBRS-High subtype was characterized by elevated levels of immune-suppressive cells and increased expression of immune checkpoint molecules. Using a Gradient Boosting Decision Tree (GBDT) machine learning approach, the FKBP1A gene was identified as playing a significant role in liver cancer. Notably, knocking down FKBP1A significantly inhibited the proliferation and metastatic capabilities of liver cancer cells both in vitro and in vivo. Our study highlights the potential of TGFBRS in predicting chemotherapy responses and in shaping the tumor immune microenvironment in liver cancer. The results identify FKBP1A as a promising molecular target for developing preventive and therapeutic strategies against liver cancer. Our findings could potentially guide personalized treatment strategies to improve the prognosis of liver cancer patients.