This study evaluated the effect of a combined infusion of dexmedetomidine and esketamine on the quality of recovery in patients undergoing modified radical mastectomy. Methods: A total of 135 patients were randomly divided into three groups: dexmedetomidine group (group D) received dexmedetomidine (0.5 µg/kg loading, 0.4 µg/kg/h infusion), dexmedetomidine plus low-dose esketamine group (group DE 1 ) received dexmedetomidine (0.5 µg/kg loading, 0.4 µg/kg/h infusion) and esketamine (0.5 mg/kg loading, 2 µg/kg/min infusion), dexmedetomidine plus high-dose esketamine group (group DE 2 ) received dexmedetomidine (0.5 µg/kg loading, 0.4 µg/kg/h infusion) and esketamine (0.5 mg/kg loading, 4 µg/kg/min infusion). The primary outcome was the overall quality of recovery-15 (QoR-15) scores at 1 day after surgery. The secondary endpoints were total QoR-15 scores at 3 days after surgery, propofol and remifentanil requirement, awaking and extubation time, postoperative visual analogue scale (VAS) pain scores, rescue analgesic, nausea and vomiting, bradycardia, excessive sedation, nightmares, and agitation. Results: The overall QoR-15 scores were much higher in groups DE 1 and DE 2 than in groups D 1 and D 3 days after surgery (P < 0.05). VAS pain scores at 6, 12, 24 h postoperatively, propofol and remifentanil requirements were significantly lower in groups DE 1 and DE 2 than in group D (P < 0.05). Compared with group D, awaking time, extubation time, and post-anesthesia care unit (PACU) stay were significantly prolonged in groups DE 1 and DE 2 (P < 0.05) and were much longer in group DE 2 than in group DE 1 (P < 0.05). The proportion of postoperative rescue analgesics and bradycardia was higher and the incidence of excessive sedation was lower in group D than in groups DE 1 and DE 2 (P < 0.05). Conclusion: Dexmedetomidine plus esketamine partly improved postoperative recovery quality and decreased the incidence of bradycardia but prolonged awaking time, extubation time, and PACU stay, especially dexmedetomidine plus 4 µg/kg/min esketamine.