To investigate the effect of a single sub-anesthetic dose of ketamine on postoperative anxiety, depression, and inflammatory factors in patients with colorectal cancer. A total of 104 patients undergoing selective colorectal surgery in our hospital from Jan 2015 to Oct 2017 were included and randomly assigned (1:1:1:1) into a 0.1 mg kg ketamine group (K1 group), 0.2 mg kg ketamine group (K2 group), 0.3 mg kg ketamine group (K3 group), or control group (C group). Corresponding doses of ketamine were given intravenously in the K groups (K1, K2, and K3 groups) 5 min before operation, and the same amount of normal saline was given in the C group. The intravenous analgesia program was identical in the four groups. The patients' emotional reactions (anxiety and depression) were assessed by the Hospital Anxiety and Depression Scale (HAD), the quality of postoperative recovery was evaluated by the Quality of Recovery-40 (QoR-40) questionnaire, and the levels of IL-6, IL-8, and TNF-α in peripheral blood were detected by enzyme-linked immunosorbent assay (ELISA) on the day before operation and within 24, 48, and 72 h post-operation respectively. Pain was estimated by the visual analog scale (VAS), and sedation was assessed with Ramsay score 30 min after extubation. The time points of anesthetic end and extubation were recorded. The complications during anesthesia and recovery such as cough and agitation 30 min after extubation were recorded. The anxiety score (HAD-A) and depression score (HAD-D) of the K3 group were significantly lower than those of the C group post-operation ( < 0.05). The QoR-40 score of the K3 group was significantly higher than that of the C group ( < 0.05). The serum levels of IL-6, IL-8, and TNF-α in the K3 group were significantly lower than those in the C group ( < 0.05 and < 0.01). There were no significant differences in HAD-A, HAD-D, and QoR-40 scores or serum levels of IL-6, IL-8, and TNF-α between the K1 and K2 groups and the C group. There were no significant differences in VAS pain score or Ramsay sedation score among the four groups 30 min after extubation. There were no significant differences in extubation time, postoperative cough, emergence agitation, or delirium among the four groups. Dizziness, nausea, vomiting, diplopia, or other adverse reactions were not found 30 min after extubation. A single sub-anesthetic dose (0.3 mg kg) of ketamine can significantly improve the postoperative anxiety and depression of colorectal cancer patients and reduce the levels of IL-6, IL-8, and TNF-α.