Magnesium can act as an adjuvant in analgesia due to its properties of calcium channel blocker and N-methyl-D-aspartate antagonist. The aim of our study was to determine if magnesium sulfate reduces perioperative analgesic requirements in patients undergoing thoracotomy procedure. Our study included 68 patients undergoing elective thoracotomy that received a bolus of 30-50 mg/kg MgSO4 followed by continuous infusion of 500 mg/h intraoperatively and 500 mg/h during the first 24 hours after the operation, or the same volume of isotonic solution (control group). Intraoperative analgesia was achieved with fentanyl and postoperative analgesia with a mixture of fentanyl and bupivacaine through epidural catheter. The level of pain was estimated using Visual Analog Scale (VAS) and TORDA pain scales. Fentanyl consumption during the operation was significantly lower in the magnesium treated group compared to control group. There was no statistically significant difference in epidural bupivacaine and fentanyl consumption during 48 hours postoperatively between the magnesium treated and control group. The measured VAS score at all intervals was similar in both groups. Postoperative TORDA scores were similar in both groups during the first 24 hours; however, a statistically significant difference was recorded in 40-48 h measurements. Results of our study revealed that magnesium reduced intraoperative analgesic requirements and also contributed to effective control of the static component of postthoracotomy pain.