Gabapentin and ketamine are popular analgesic adjuvants for improving perioperative pain management. We designed this double-blind, placebo-controlled study to test and compare the preventive effects of perioperative ketamine and gabapentin on early and chronic pain after elective hysterectomy. Sixty patients undergoing abdominal hysterectomy were randomly assigned to 1 of the following 3 groups: control group received oral placebo capsules and bolus plus infusion of saline; ketamine group received oral placebo capsules and, before incision, 0.3 mg/kg IV bolus and 0.05 mgxkg(-1)xh(-1) infusion of ketamine until the end of surgery; and gabapentin group received oral gabapentin 1.2 g and bolus plus infusion of saline. The anesthetic technique was standardized, and the postoperative assessments included verbal rating scales for pain and sedation, IV morphine usage, quality of recovery assessment, recovery of bowel function, resumption of normal activities, and patient satisfaction with their pain management. Patients were questioned at 1, 3, and 6 mo after surgery for chronic postoperative pain. Postoperative pain scores were significantly lower in the gabapentin group compared with the ketamine and control groups, and patient-controlled analgesia morphine use was significantly reduced in both treatment groups (versus control group) (P < 0.001). Total patient-controlled analgesia morphine use was decreased by 35% and 42% in the ketamine and gabapentin groups, respectively, compared with the control group (P < 0.001). Patient satisfaction with pain treatment was significantly improved in the ketamine and gabapentin groups compared with the control group (P < 0.001). The incidence of incisional pain and related pain scores at the 1-, 3-, and 6-mo follow-up were significantly lower in the gabapentin group compared with the ketamine and control groups (P < 0.001). Gabapentin and ketamine are similar in improving early pain control and in decreasing opioid consumption; however, gabapentin also prevented chronic pain in the first 6 postoperative months.