Objective: Addiction is often conceptualized as a behavioral strategy for avoiding negative experiences. In rodents, opioid intake has been associated with abnormal acquisition and extinction of avoidance behavior. Here, we tested the hypothesis that these findings would generalize to human opioid-dependent subjects. Method: Adults meeting DSM-IV criteria for heroin dependence and treated with opioid medication (n = 27) and healthy controls (n = 26) were recruited between March 2013 and October 2013 and given a computer-based task to assess avoidance behavior. For this task, subjects controlled a spaceship and could either gain points by shooting an enemy spaceship or hide in safe areas to avoid on-screen aversive events. Hiding duration during different periods of the task was used to measure avoidance behavior. Results: While groups did not differ on escape responding (hiding) during the aversive event, heroin-dependent men (but not women) made more avoidance responses during a warning signal that predicted the aversive event (analysis of variance, sex × group interaction, P = .007). Heroin-dependent men were also slower to extinguish the avoidance response when the aversive event no longer followed the warning signal (P = .011). This behavioral pattern resulted in reduced opportunity to obtain reward without reducing risk of punishment. Results suggest that, in male patients, differences in avoidance behavior cannot be easily explained by impaired task performance or by exaggerated motor activity. Conclusions: This study provides evidence for abnormal acquisition and extinction of avoidance behavior in opioid-dependent patients. Interestingly, data suggest that abnormal avoidance is demonstrated only by male patients. Findings shed light on cognitive and behavioral manifestations of opioid addiction and may facilitate development of therapeutic approaches to help affected individuals.