Purpose A prospective randomized clinical trial was carried out to observe the analgesic efficacy of ropivacaine for postoperative pain following thoracolumbar spinal surgery. Methods Seventy-one patients with elective posterior thoracolumbar spinal surgery were randomly divided into two groups. Local group received 0.33 % ropivacaine by pump through the wound, and intravenous group received flurbiprofen axetil, pentazocine and palonosetron via intravenous pump. We evaluated the level of pain, the incidence of adverse reactions at 2, 4, 6, 12, 24, 36 and 48 h after operation, and the occurrence of chronic pain 3 months later. Results There were no significant differences in the pain level between the two groups. However, the incidence of nausea, vomiting and chronic pain was significantly lower in the local group. Conclusions Our results showed that local infusion of ropivacaine achieved similar analgesic effects to intravenous delivery of analgesic drugs, but significantly reduced incidence of nausea, vomiting and chronic pain.