Although opioids are potent analgesics, a consequence of chronic opioid use is hyperalgesia during withdrawal, which may contribute to opioid misuse. Dynorphin, the endogenous ligand of κ-opioid receptors (KORs), is upregulated in opioid-dependent rats and in animal models of chronic pain. However, the role of KORs in opioid withdrawal-induced hyperalgesia remains to be determined. We hypothesized that KOR antagonism would reverse opioid withdrawal-induced hyperalgesia in opioid-dependent rats. Male and female Wistar rats received daily injections of heroin (2-6 mg/kg, SC) and were tested for mechanical sensitivity in the electronic von Frey test 4-6 h into withdrawal. Female rats required significantly more heroin than male rats to reach comparable levels of both heroin-induced analgesia and hyperalgesia (6 mg/kg vs. 2 mg/kg). Once hyperalgesia was established, we tested the effects of the KOR antagonists nor-binaltorphimine (norBNI; 30 mg/kg, SC) and 5'-guanidinonaltrindole (5'GNTI; 30 mg/kg, SC). When the animals continued to receive their daily heroin treatment (or saline treatment in the repeated saline group) five times per week throughout the experiment, both KOR antagonists reversed heroin withdrawal-induced hyperalgesia. The anti-hyperalgesia effect of norBNI was more prolonged in males than in females (14 days vs. 7 days), whereas 5'GNTI had more prolonged effects in females than in males (14 days vs. 4 days). The behavioral effects of 5'GNTI coincided with higher 5'GNTI levels in the brain than in plasma when measured at 24 h, whereas 5'GNTI did not reverse hyperalgesia at 30 min posttreatment when 5'GNTI levels were higher in plasma than in the brain. Finally, we tested the effects of 5'GNTI on naloxone-induced and spontaneous signs of opioid withdrawal and found no effect in either male or female rats. These findings indicate a functional role for KORs in heroin withdrawal-induced hyperalgesia that is observed in rats of both sexes.