Preclinical findings suggest that the inhibition of NMDA glutamatergic neurotransmission may have beneficial effects in the treatment of cocaine dependence. We hypothesized that memantine, a low potency, uncompetitive NMDA receptor antagonist, would be safe and effective in the treatment of cocaine dependence, particularly in preventing relapse to cocaine use in abstinent individuals. Cocaine dependent patients ( N = 112) were enrolled. The trial began with a 2-week placebo lead-in period during which patients received high-value voucher contingency management to induce abstinence. Participants were then randomized to receive either memantine 20 mg bid ( N = 39) or placebo ( N = 42) for 12-weeks in combination with individual relapse-prevention therapy. The randomization was stratified by abstinence status during the lead-in period. The primary outcome was the weekly proportion of days of cocaine use. There were no significant differences in cocaine use outcome between the groups treated with memantine versus placebo. Thus, the efficacy of memantine 40 mg/d for the treatment of cocaine dependence was not supported. Urine-confirmed abstinence during the lead-in period was achieved by 44% of participants, and was a strong predictor of subsequent cocaine abstinence during the trial. This suggests that this clinical trial design, an intensive behavioral intervention during a lead-in period, resolves cocaine dependent patients into two subgroups, one that rapidly achieves sustained abstinence and may not need a medication, and another that displays persistent cocaine use and would most likely benefit from a medication to help induce abstinence. Targeting the latter subgroup may advance medication development efforts.