Therapeutic targeting of the transforming growth factor beta (TGFβ) pathway in cancer represents a clinical challenge since TGFβ exhibits either tumor suppressive or tumor promoting properties, depending on the tumor stage. Thus, treatment with galunisertib, a small molecule inhibitor of TGFβ receptor type 1, demonstrated clinical benefits only in subsets of patients. Due to the functional duality of TGFβ in cancer, one can hypothesize that inhibiting this pathway could result in beneficial or adverse effects depending on tumor subtypes. Here, we report distinct gene expression signatures in response to galunisertib in PLC/PRF/5 and SNU‐449, two cell lines that recapitulate human hepatocellular carcinoma (HCC) with good and poor prognosis, respectively. More importantly, integrative transcriptomics using independent cohorts of patients with HCC demonstrates that galunisertib‐induced transcriptional reprogramming in SNU‐449 is associated with human HCC with a better clinical outcome (i.e., increased overall survival), while galunisertib‐induced transcriptional reprogramming in PLC/PRF/5 is associated with human HCC with a worse clinical outcome (i.e., reduced overall survival), demonstrating that galunisertib could indeed be beneficial or detrimental depending on HCC subtypes. Collectively, our study highlights the importance of patient selection to demonstrate a clinical benefit of TGFβ pathway inhibition and identifies Serpin Family F Member 2 (SERPINF2) as a putative companion biomarker for galunisertib in HCC.