Co-analgesics are often combined with opioids to reduce the prevalence of opioid adverse effects while maintaining or even improve the quality of analgesia. Magnesium is an essential mineral which modulates nociceptive processing by action on NMDA receptors, calcium, potassium, and TRP ion channels, nitric oxide synthases, and has other mechanisms of action. Several lines of evidence indicate that magnesium enhances the effects of opioids, general and local anesthetics. In humans, perioperative intravenous magnesium sulfate (MS) was demonstrated to be effective in reducing postoperative pain and postoperative consumption of analgesics. MS given as an adjuvant of local anesthetics in neuraxial anesthesia might be more effective than after systemic administration. Also, in combination with local anesthetics, MS may prolong nerve block, regional intravenous and infiltration anesthesia. Applied topically, as a sole drug, MS significantly reduces the postoperative sore throat. However, not all trials showed postoperative analgesic efficacy of systemically or locally applied MS. The use of MS is accompanied by few side effects. However, the risk of neurological complications resulting from neuraxial administration of MS has not yet been investigated in detail. For the time being, the small number of subjects and the heterogeneity of the methodology in the trials (different doses, route and length of administration, different efficacy parameters) limit the ability to draw definitive conclusions about the role of perioperative MS in the treatment of postoperative pain.