Heroin, like various illicit substances, has a negative impact on the frontal cognitive function after repeated abuse. We used functional magnetic resonance imaging (fMRI) to examine the neural substrates of response inhibition and competition in 18 healthy controls and assess the frontal neurocognition in 30 abstinent heroin dependents (AHD) as they performed a Go/NoGo Association task with reaction times recorded spontaneously. The neural response which was induced by response inhibition was prominent in the midline structure, specifically the bilateral medial prefrontal gyrus and anterior cingulated cortex, as well as the left middle frontal gyrus, insula, bilateral inferior frontal gyrus and limbic system. Unlike drug-naïve controls, only the bilateral superior frontal gyrus and left middle frontal gyrus were activated in AHD. Furthermore, the RT of AHD was significantly longer than that of controls. The results suggest that: (1) the ACC, mPFC and inferior frontal lobe play an important role in response inhibition and competition; (2) heroin dependents had an impaired response inhibition function that lasted even months into abstinence, which indicates that the negative effect of heroin on the inhibitory function still continues in early protracted withdrawal state.