Analgesic treatment with anti‑inflammatory drugs may aid the prevention of postoperative pain and the attenuation of the postoperative immune inflammatory response. The current study presents a randomized, double‑blind controlled study, which was performed to investigate the levels of Th1, Th2, Th17 and Treg cytokines, including interleukin (IL)‑2, interferon (IFN)‑γ, IL‑4, IL‑10, IL‑17, IL‑23 and transforming growth factor (TGF)‑β in the peripheral blood of patients with cervical cancer following laparoscopy. The effects of perioperative multi‑dose parecoxib on postoperative immune function was evaluated. A total of 80 patients with cervical cancer (stage IB/IIA, ASA I‑III, aged 18‑65 years) that were scheduled for laparoscopy were randomly assigned into either the parecoxib (I; n=40) or control (II; n=40) groups. Group I received 40 mg parecoxib 30 min prior to surgery and then every 12 h subsequent to surgery for 60 h, and group II received normal saline at the corresponding time points. Intravenous tramadol (100 mg) was prescribed for pain relief as required. The mRNA and protein expression levels of cytokines in the peripheral blood were detected by quantitative polymerase chain reaction and ELISA. Pain visual analog scales (VAS) and incidence, analgesic relief, adverse events and the length of hospital stay were recorded. It was demonstrated that the mRNA and protein levels of IL‑2, IFN‑γ and IL‑17 in the two groups were reduced subsequent to surgery, while mRNA and protein expression levels of IL‑4, IL‑10 and TGF‑β were enhanced. Administration of multi‑dose parecoxib may diminish the increase in postoperative IL‑2, IFN‑γ and IL‑17 levels, and suppress the excessive production of IL‑4, IL‑10 and TGF‑β. This effect is accompanied by lower VAS scores, pain incidence, postoperative nausea/vomiting and infections. In conclusion, perioperative multi‑dose parecoxib was able to alleviate postoperative pain and ameliorate surgery‑induced immune suppression by balancing Th1, Th2, Th17 and Treg cytokines following laparoscopy in patients with cervical cancer. The current study provides support to the hypothesis that parecoxib may be a more effective therapeutic strategy than the currently available options, for postoperative pain and immune function management of patients with cancer.