Magnesium plays an important role in the prevention of central sensitization and in the attenuation of established pain hypersensitivity, and its main mode of action appears to involve its voltage-gated antagonist action at N-methyl-D-aspartate (NMDA) receptor. Given the putative function of the NMDA receptor in pain transduction, magnesium has been investigated in various clinical conditions associated with acute or chronic pain. The parenteral administration of magnesium, via an intravenous, intrathecal, or epidural route, may reduce pain, and anesthetic and analgesic requirements during the intra- and postoperative periods. The beneficial effects of magnesium treatment have also been demonstrated in patients suffering from neuropathic pain, such as, in those with malignancy-related neurologic symptoms, postherpetic neuralgia, diabetic neuropathy, and chemotherapy-induced peripheral neuropathy. In addition, magnesium therapy has been shown to be effective at alleviating dysmenorrhea, headaches, and acute migraine attacks. Magnesium is playing an evolving role in pain management, but a more thorough understanding of the mechanism underlying its antinociceptive action and additional clinical studies are required to clarify its role as an analgesic adjuvant.