Cyclooxygenase (COX)-2 inhibitors are widely used for postoperative pain control in clinical practice. However, it is unknown whether spinal sensitization is involved in the analgesic effects of COX-2 inhibitors on surgical pain. Extracellular signal-regulated kinase (ERK) in the spinal cord is implicated in various types of pain, including surgical pain. The present study investigated the role of spinal ERK signaling in the analgesic effect of the COX-2 inhibitor parecoxib on surgical pain. Surgical pain was produced in rats by surgical incision of the hind paw. Phosphorylated (p)-ERK1/2 expression was determined by immunohistochemistry. Pain hypersensitivity was evaluated by measuring the paw withdrawal threshold using the von Frey test. The selective COX-2 inhibitor parecoxib was delivered 20 min before or 20 min after the incision by intraperitoneal injection. Pretreatment with parecoxib markedly attenuated the pain hypersensitivity induced by incision. However, posttreatment with parecoxib produced minimal analgesic effects. Parecoxib inhibited the increase in spinal p-ERK expression following surgical incision. The present study thus suggests that the COX-2 inhibitor parecoxib exerts its analgesic effect on surgical pain through the inhibition of neuronal ERK activation in the spinal cord. COX-2 inhibitor delivery prior to surgery has more potent analgesic effects, suggesting the advantage of preventive analgesia for post-operative pain control.