The effects of dezocine and sufentanyl on the activity of natural killer (NK), CD4
+
and CD8
+
cells in patients with breast cancer undergoing postoperative analgesia after radical mastectomy were compared. The clinical data of 76 female patients undergoing radical mastectomy in the Fudan University Shanghai Cancer Center from January 2015 to October 2017 were analyzed retrospectively. Forty-two patients treated with dezocine were group D and 34 patients with sufentanyl were group S. Visual analogue scale (VAS) was used to evaluate the analgesic effect at 3, 12, 24, 48 h after surgery. There was no significant difference in VAS score, NK cells, CD4
+
cells, and CD8
+
cell vitality at 3 h postoperatively between the two groups (P>0.05), and VAS score at 12, 24 and 48 h postoperatively in the S group was significantly lower than that in group D (P<0.05). The activity of NK cells and CD4
+
cells at 3, 12, 24 and 48 h after surgery in group D was significantly higher than that in group S, and the difference was statistically significant (P<0.05). The activity of CD8
+
cells at 3, 12, 24 and 48 h after surgery in group D was significantly lower than that in group S, and the difference was statistically significant (P<0.05). The analgesic effect of dezocine was slightly worse than that of sufentanyl, but it was more beneficial to the recovery of early postoperative immune function.