Objective To explore the effect of endoscopic variceal ligation(EVL)as a primary preventive measure for esophageal varices on the prognosis of patients with primary hepatocellular carcinoma(HCC).Methods A total of 149 pa-tients with HCC treated for the first time from January 2020 to December 2022 were selected and divided into observation group(n=75)and control group(n=74)according to random number table method.The observation group received EVL treat-ment,while the control group did not.The improvement of esophageal venous bleeding and varicose veins in the two groups was monitored,and the survival of the patients during follow-up was recorded.COX regression was used to analyze the influ-encing factors of poor prognosis in HCC patients.Results The rates of esophageal venous bleeding in the observation group at 3,6 and 12 months after treatment were significantly lower than those in the control group(P<0.05).The total effective rate of esophageal varices improvement in the observation group[76.00%(57/75)]was significantly higher than that in the control group[59.46%(44/74)](P<0.05).Total mortality rate[18.67%(14/75)],and mortality rate due to gastrointestinal bleeding[4.00%(3/75)]in the observation group were significantly lower than those in the control group[33.78%(25/74),16.22%(12/74)](P<0.05).Kaplan-Meier survival curve showed that the total survival time of the observation group was significantly lon-ger than that of the control group(P<0.05).Multivariate COX regression analysis showed that EVL was an independent protec-tive factor for poor prognosis of HCC patients(HR=0.529,95%CI:0.285,0.865,P<0.05).Conclusion EVL can significantly reduce the risk of esophageal venous bleeding and improve the prognosis of HCC patients.Therefore,EVL therapy can be con-sidered as the preferred treatment strategy for primary prevention of esophageal varices in HCC patients.