Background Quadratus lumborum (QL) block is increasingly being used as a new abdominal nerve block technique. In some studies of mid and lower abdominal and hip analgesia, continuous QL block achieved favorable outcomes as an alternative to continuous intravenous analgesia with opioids. However, the use of continuous QL block for upper abdominal pain is less well characterized. This study aimed to investigate the effects of continuous anterior QL block (CQLB) on postoperative pain and recovery in patients undergoing open liver resection. Methods Sixty-three patients underwent elective open liver resection were randomly divided into continuous anterior QL block (CQLB, n = 32) group and patient-controlled intravenous analgesia (PCIA, n = 31) group. Patients in CQLB group underwent ultrasound-guided anterior QL block at the second lumbar vertebral transverse processes before general anesthesia, followed by postoperative CQLB analgesia. Patients in PCIA group underwent continuous intravenous analgesia postoperatively. Postoperative numerical rating scale (NRS) pain scores upon coughing and at rest, self-administered analgesic counts, rate of rescue analgesic use, time to first out-of-bed activity and anal flatus after surgery, and incidences of analgesic-related adverse effects were recorded. Results Postoperative NRS pain scores on coughing in CQLB group at different time points and NRS pain score at rest 48 h after surgery were significantly lower than those in PCIA group (P <0.05). Time to first out-of-bed activity and anal flatus after surgery in CQLB group were significantly earlier than those in PCIA group (P <0.05). No significant differences of postoperative self-administered analgesic counts, rate of postoperative rescue analgesic usage, or incidences of analgesic-related adverse effects were found between the two groups (P >0.05). Conclusions Ultrasound-guided anterior QL block significantly alleviated the pain during coughing after surgery, shortened the time to first out-of-bed activity and anal flatus, promoting postoperative recovery of the patients undergoing open liver resection.