The aim of this study was to test the hypothesis that the induction and maintenance of anesthesia with the use of fentanyl or ketamine reduces postoperative pain and wound hyperalgesia beyond the period when these effects can be explained by the direct analgesic action of these drugs. Twenty-seven patients scheduled for elective hysterectomy were investigated in a double-blind, randomized study. Patients were divided into three groups. In the fentanyl group, anesthesia was induced with fentanyl 5 μg/kg combined with thiopental 3 mg/kg and maintained with isoflurane and fentanyl 0.02 μg.kg-1min-1. In the ketamine group, anesthesia was induced with ketamine 2 mg/kg in combination with thiopental 3 mg/kg and maintained with isoflurane and ketamine 20 μg.kg-1min-1. In the control group, anesthesia was induced with thiopental 5 mg/kg and maintained with isoflurane only. Patients in all three groups received identical postoperative pain treatment. The intensity of spontaneous incisional pain and movement-associated pain was measured with a visual analog self-rating method. The surgical wound hyperalgesia was assessed by measuring pain threshold to pressure on the wound by using an algometer, and also by measuring the intensity of pain to suprathreshold pressure on the wound with the visual analog self-rating method. Forty-eight hours after surgery, the pain threshold was 0.90 ± 0.06 kg in controls, 1.69 ± 0.19 kg (P < 0.001) in the fentanyl group, and 1.49 ± 0.15 kg (P < 0.01) in the ketamine group. The intensity of pain to suprathreshold pressure on the wound was decreased in both groups compared with the control group. However, there were no statistically significant changes in spontaneous incisional or movement-associated pain compared with the control group. The results suggest that fentanyl and ketamine preemptively decrease postoperative wound hyperalgesia.