Objective Enhanced reactivity to substance related cues is a central characteristic of addiction and has been associated with increased activity in motivation, attention, and memory related brain circuits and with a higher probability of relapse. Modafinil was promising in the first clinical trials in cocaine dependence, and was able to reduce craving in addictive disorders. However, its mechanism of action remains to be elucidated. In this functional magnetic resonance imaging (fMRI) study therefore, cue reactivity in cocaine dependent patients was compared to cue reactivity in healthy controls (HCs) under modafinil and placebo conditions. Methods An fMRI cue reactivity study, with a double-blind, placebo-controlled cross-over challenge with a single dose of modafinil (200 mg) was employed in 13 treatment seeking cocaine dependent patients and 16 HCs. Results In the placebo condition, watching cocaine-related pictures (versus neutral pictures) resulted in higher brain activation in the medial frontal cortex, anterior cingulate cortex, angular gyrus, left orbitofrontal cortex, and ventral tegmental area (VTA) in the cocaine dependent group compared to HCs. However, in the modafinil condition, no differences in brain activation patterns were found between cocaine dependent patients and HCs. Group interactions revealed decreased activity in the VTA and increased activity in the right ACC and putamen in the modafinil condition relative to the placebo condition in cocaine dependent patients, whereas such changes were not present in healthy controls. Decreases in self-reported craving when watching cocaine-related cues after modafinil administration compared to the placebo condition were associated with modafinil&#8208;induced increases in ACC and putamen activation. Conclusions Enhanced cue reactivity in the cocaine dependent group compared to healthy controls was found in brain circuitries related to reward, motivation, and autobiographical memory processes. In cocaine dependent patients, these enhanced brain responses were attenuated by modafinil, mainly due to decreases in cue&#8208; reactivity in reward&#8208;related brain areas (VTA) and increases in cue reactivity in cognitive control areas (ACC). These modafinil&#8208;induced changes in brain activation in response to cocaine-related visual stimuli were associated with diminished self-reported craving. These findings imply that in cocaine dependent patients, modafinil, although mainly known as a cognitive enhancer, acts on both the motivational and the cognitive brain circuitry.