Background. Magnesium has antinociceptive effects in animal and human models of pain. Our hypothesis was that the addition of magnesium to postoperative epidural infusion of fentanyl may decrease the need for fentanyl. Methods. Fifty patients undergoing hip surgery were enrolled to receive either fentanyl (Group F) or fentanyl plus magnesium sulphate (Group FM) for 24 h for epidural analgesia. All patients were equipped with a patient-controlled epidural analgesia device and the initial settings of a demand bolus dose of fentanyl 25 μg. In Group FM, patients received 50 mg magnesium sulphate epidurally as an initial bolus dose followed by a continuous infusion of 100 mg day-1. Ventilatory frequency, heart rate, blood pressure, pain assessment using a visual analogue scale (VAS), sedation scores and fentanyl consumption were recorded in the postoperative period. Results. There was no significant difference between groups in the time to first analgesic requirement. Compared with Group F, patients in Group FM received smaller doses of epidural fentanyl (P < 0.05). The cumulative fentanyl consumption in 24 h was 437 (SD 110) μg in Group F and 328 (121) μg in Group FM (P < 0.05). Patients in Group F showed a higher VAS score in the first hour of the postoperative period (P < 0.05). The groups were similar with respect to haemodynamic and respiratory variables, sedation, pruritis, and nausea. Conclusion. Co-administration of magnesium for postoperative epidural analgesia results in a reduction in fentanyl consumption without any side-effects. © The Board of Management and Trustees of the British Journal of Anaesthesia 2007. All rights reserved.