Rectus sheath block is an emerging technique that provide effective perioperative analgesia and is related to lower perioperative opioid consumption and decrease opioid-related adverse effects. The present research is designed to explore the effect of rectus sheath block on recovery quality in patients following transabdominal midline gynecological surgery. Ninety female patients following elective transabdominal midline gynecological surgery were enrolled. Patients were randomized to group R (n = 45) which receive preoperative ultrasound-guided RSB with 0.4% ropivacaine or group C which is control group (n = 45). The primary outcome was the quality of recovery on the first postoperative day. The quality of recovery was assessed by the 40-item Quality of Recovery questionnaire (QoR-40). Secondary outcomes included the intraoperative opioid consumption, time to first flatus and time to first discharging from bed, postoperative nausea and vomiting, and patient satisfaction. The patients in two groups had comparable baseline characteristics. Postoperative global QoR-40 scores were significantly better in group R than in group C (165.0[159.5-170.0] vs 155.0[150.0-157.0], respectively; median difference 12[95% confidence interval: 8-15, P<0.001]). Preoperative RSB reduced intraoperative opioid consumption, reduced the time to first flatus, time to first discharging from bed and the post anaesthesia care unit discharge time. Furthermore, group R showed greater patient satisfaction. A single preoperative administration of RSB with ropivacaine improved the quality of recovery in patients following transabdominal midline gynecological surgery.