This study aimed to explore the role of Helicobacter pylori (Hp) eradication in patients with hepatogenic ulcer (HU). Patients with HU, patients with liver cirrhosis without peptic ulcer and patients with functional dyspepsia (FD) were selected and the relationship between complications of liver cirrhosis and Hp infection in HU patients was evaluated retrospectively. Furthermore, 60 HU patients with Hp infection were randomly divided into the treatment group with rabeprazole plus amoxicillin and levofloxacin, and the control group with rabeprazole alone and the therapeutic effects then were recorded. This trial was registered at the China Clinical Research Registration Center (Trial registration number: ChiCTR2200061355, 2022/06/21). The Hp positive rate in the HU group was significantly higher compared with the liver cirrhosis without ulcer group or the FD group. Moreover, the positive rate of Hp in HU patients with mild esophageal varices was higher than that in HU patients with moderate and severe esophageal varices. Additionally, the rate of Hp eradication and ulcer healing in the treatment group was significantly higher than that in the control group. Importantly, the remission time of ulcer-related symptoms in the treatment group was shorter compared with the control group. Hp is a contributor to HU and an integrated strategy consisting of rabeprazole, amoxicillin and levofloxacin is effective in the treatment of HU, providing a potential application for HU patients.