Methamphetamine (MA)-dependent individuals exhibit deficits in cognition and prefrontal cortical function. Therefore, medications that improve cognition in these subjects may improve the success of therapy for their addiction, especially when cognitive behavioral therapies are used. Modafinil has been shown to improve cognitive performance in neuropsychiatric patients and healthy volunteers. We therefore conducted a randomized, double-blind, placebo-controlled, cross-over study, using functional magnetic resonance imaging, to examine the effects of modafinil on learning and neural activity related to cognitive function in abstinent, MA-dependent, and healthy control participants. Modafinil (200 mg) and placebo were administered orally (one single dose each), in counterbalanced fashion, 2 h before each of two testing sessions. Under placebo conditions, MA-dependent participants showed worse learning performance than control participants. Modafinil boosted learning in MA-dependent participants, bringing them to the same performance level as control subjects; the control group did not show changes in performance with modafinil. After controlling for performance differences, MA-dependent participants showed a greater effect of modafinil on brain activation in bilateral insula/ventrolateral prefrontal cortex and anterior cingulate cortices than control participants. The findings suggest that modafinil improves learning in MA-dependent participants, possibly by enhancing neural function in regions important for learning and cognitive control. These results suggest that modafinil may be a suitable pharmacological adjunct for enhancing the efficiency of cognitive-based therapies for MA dependence.