BackgroundAfatinib is mainly used to treat advanced non-small cell lung cancer, but its therapeutic effect on hepatocellular carcinoma is still unclear.MethodsOver 800 drugs were screened by CCK8 technology and afatinib was found to have a significant inhibitory effect on liver cancer cells. The expression of PDL1 in tumor cells treated with drugs were detected by qRT-PCR and Weston Blot experiments. The effects of afatinib on the growth, migration and invasion of HCC cells were evaluated using wound healing, Transwell, and cell cloning assays. The in vivo effects of afatinib in combination with anti-PD1 were evaluated in C57/BL6J mice with subcutaneous tumorigenesis. Bioinformatics analysis was performed to explore the specific mechanism of afatinib's inhibition of ERBB2 in improving the expression level of PD-L1, which was subsequently verified through experiments.ResultsAfatinib was found to have a significant inhibitory effect on liver cancer cells, as confirmed by in vitro experiments, which demonstrated that it could significantly suppress the growth, invasion and migration of HCC cells. qRT PCR and Weston Blot experiments also showed that Afatinib can enhance the expression of PD-L1 in tumor cells. In addition, in vitro experiments confirmed that afatinib can significantly enhance the immunotherapeutic effect of hepatocellular carcinoma. Afatinib’s ability to increase PD-L1 expression is mediated by STAT3 activation following its action on HCC cells.ConclusionAfatinib enhances PD-L1 expression in tumor cells through the STAT3/PD-L1 pathway. The combination of afatinib and anti-PD1 treatment significantly increases the immunotherapeutic effect of HCC.