Both in vitro and in animal studies have shown immunosuppressive effects of opioids which might provoke tumour growth and metastasis, while no definite results were shown in previous clinical studies. To find out the effects between general anaesthesia combined with sufentanil target-controlled infusion (SGA) and general anaesthesia combined with epidural anaesthesia (EGA) on immunological alterations, stress responses and prognosis in patients undergoing open hepatectomy, a prospective, non-inferiority, randomized-controlled study was performed. Patients with liver neoplasms undergoing open hepatectomy were randomly assigned to either SGA (n=81) or EGA (n=81) group. The primary outcome was the ratio of interferon (IFN)-γ/interleukin (IL)-4 at 24 h after surgery (T3). The secondary outcomes included immune-related cytokines, circulating immune cells, stress-related cytokines, cortisol and blood glucose, visual analogue scale scores. Plasma was sampled at five-time points [baseline/before surgery (T0), 5 min after portal block release (T1), 1 h after surgery (T2), T3, and on a postoperative day (POD)5 (T4)]. Cancer-related outcomes, including recurrence, metastasis and survival, were followed up at 3 months and 1 year after surgery. The IFN-γ/IL-4 ratios were comparable between both groups at T3 {median [interquartile range (IQR)]: 20.78 (12.73-29.18) vs. 19.52 (13.98-29.29), P=0.607}. At T3, the proportions of circulating T cells were decreased, while those of B and natural killer cells were increased. The plasma level of tumour necrosis factor (TNF)-α at T2 was significantly higher in the SGA group [median (IQR): 7.45 (6.20-9.80) vs. 5.95 (4.95-7.45) pg/mL, P<0.001]. Patient-controlled intravenous analgesia was less effective than epidural analgesia on POD0 and POD2. For hepatocellular carcinoma (HCC)-related outcomes, no significant differences were found in either short- or long-term follow-ups. Although the levels of TNF-α were higher in the SGA group, the tumour-related immunological alterations and follow-ups showed no difference between groups. SGA appears not to be inferior to EGA regarding tumour-related immunity and prognosis. Intravenous opioid use appears not to be inferior to epidural anaesthesia, and can be used safely in HCC patients without worsening patients' prognosis. Chinese Clinical Trial Registry (No. ChiCTR2000035299).