Relieving perioperative pain can reduce postoperative suffering and improve recovery from anaesthesia in animals. The aim of this study was to compare the analgesic effects of nefopam and tramadol in dogs undergoing ovariohysterectomy. Twenty-four adult mixed-breed female dogs were randomly divided into three groups (n = 8) and received their respective treatments immediately after surgery: Group T (2 mg/kg tramadol, i.v.), Group C (1 mg/kg nefopam, i.v.) and Group D (2 mg/kg nefopam, i.v.). The heart rate (HR), mean arterial pressure (MAP), respiratory rate (RR) and rectal temperature (RT) were measured and the level of analgesia was assessed using the Glasgow Composite Measure Pain Scale (CMPS-SF). The CMPS-SF was performed at least two days before premedication (baseline), every 2 h for the first 8 h (post-extubation), at 12 h and at 24 h. Results showed that the HR in all groups was significantly (P < 0.05) higher at 2 and 6 h than at baseline. The RR in Group T was significantly higher (P < 0.05) at 0 and 2 h than at baseline. Rescue analgesia (0.2 mg/kg morphine, i.v.) was provided if CMPS-SF pain scores greater than or equal to six. Four dogs required rescue analgesia: one dog in Group T at 2 h and three dogs in Group C at 2 and 6 h. No dogs in Group D required rescue analgesia. The CMPS-SF pain scores of dogs in Group C were significantly higher (P < 0.05) than those in Group T at 6, 8 and 12 h. The scores in Group D were significantly lower (P < 0.05) than those in Group C at 2, 4, 6, 8 and 12 h. The scores in Group D were significantly lower (P < 0.05) than those in Group T at 2 and 4 h. However, the scores in Group D were not significantly different compared with Group T. In conclusion, this study suggests that nefopam at 2 mg/kg i.v. produces better postoperative analgesia compared with tramadol at 2 mg/kg i.v. or nefopam at 1 mg/kg i.v. in dogs undergoing ovariohysterectomy.