Background Patient-controlled epidural analgesia (PCEA) has not been widely used after gastrectomy, although, in other abdominal surgery, it benefits patients more than patient-controlled intravenous analgesia (PCIA). We attempted to determine the effect of PCEA compared with PCIA on postoperative pain control and recovery after gastrectomy for gastric cancer. Methods A randomized controlled clinical trial that included patients undergoing D2 radical gastrectomy for gastric cancer was conducted for this study. Patients were randomized to a morphine-bupivacaine PCEA group and a morphine PCIA group. Postoperative outcomes such as pain, fasting blood glucose (FBG), time to first passage of flatus, complications, and time staying in hospital after surgery were compared with an intention-to-treat analysis. Results Between March 2010 and October 2010, 67 patients were randomized and 60 were evaluated. The PCEA group showed lower pain scores both at rest and on coughing after the operation (P \ 0.05). FBG after the operation was significantly lower in the PCEA group than that in the PCIA group (P \ 0.05). Time to first passage of flatus after surgery was shorter in the PCEA group (P \ 0.05), while there were no significant differences regarding the incidence of complications between the two groups in terms of the clinical records. The length of hospital stay in the PCEA group was 10.7 ± 1.7 days, which was significantly shorter than that in the PCIA group (11.9 ± 1.8 days, P \ 0.05). Conclusions After gastrectomy for gastric cancer, PCEA, compared with PCIA, offered safer pain relief with superior pain control and resulted in a lower stress response and a quicker return of bowel activity.