This controlled, completely randomized trial was designed to compare the efficacy and safety of tramadol and pentazocine in the treatment of postoperative pain. A total of 50 adults were admitted (31 males, 19 females, mean age 48 years) to undergo hemorrhoidectomy or traumatological or abdominal surgery. Following a randomization list, each patient was given one ampul of tramadol (100 mg/2 mL) or pentazocine (30 mg/mL) by intramuscular injection at 8-h intervals for 3 days. Efficacy was assessed on both the basis of severity of pain (rated using a visual analog scale in the 6th h after the first injection and during the 3 days of treatment), and quality of sleep (rated using a five-point scale). Local reactions at the injection site (pain, skin reactions) were also assessed, as were systemic reactions (vital parameters, blood and biochemistry tests), and any untoward events were reported. Both drugs had good antalgic activity, significantly relieving pain in the 3 days of treatment (p < 0.01 from baseline). The first dose of tramadol was significantly more effective than pentazocine after the 1st h and throughout the subsequent 5 h. Final judgments on efficacy and acceptability were in favor of tramadol (p < 0.01 from pentazocine). Local and systemic safety were good, with no reactions at the injection site and no changes in vital parameters or laboratory findings. No patient reported any adverse reactions.