Objectives There is a growing body of evidence suggesting that N-methyl-D-aspartate (NMDA) receptor antagonists effectively counteract somatic and behavioral symptoms of the opioid withdrawal syndrome in humans and in laboratory animals. NMDA receptor blockade also reduces the development and expression of drug-conditioned behaviors. At present, there is only one NMDA receptor antagonist, memantine, registered for clinical use in Russia. Memantine is used in Europe for the treatment of Parkinson's disease and senile dementias. Most of heroin addicts soon after the termination of withdrawal syndrome are suffering from protracted withdrawal (syndrome of anhedonia [SA]), which includes affective disorders (depression and anxiety) and craving for heroin. SA is viewed as a major factor contributing to the relapse to heroin use. The aim of this study was to evaluate efficacy of memantine in the treatment of protracted withdrawal (SA) in recently detoxified heroin addicts. Methods Following standard detoxification procedures (7–10 days), 67 heroin addicts were randomly assigned to 1 of 3 treatment groups: memantine (n = 21), amitriptyline (n = 24) or placebo (n = 22). While inpatients, subjects received one of the following medications: memantine (initial dose of 10 mg/day was gradually increased to the final dose of 30 mg/day over a period of 1 week), amitriptyline (75 mg/day), or placebo for a period of three weeks. Patients from all treatment groups received standard psychotherapy and counseling and were required to attain abstinence from heroin by providing a heroin-free urine toxicology screen prior to starting medications and at the end of each treatment week. The study design was single blind. Outcome measures included treatment retention, heroin craving (Visual Analog Scale), depression (Zung's scale), anxiety (Spielberger's scale) and anhedonia (Anhedonia syndrome scale) scores. Results Both memantine and amitriptyline significantly reduced heroin craving, depression, state and trait anxiety, and anhedonia scores at the end of the three-week treatment period; placebo did not have any significant effects. The dropout rate in the memantine group was significantly lower than that in either placebo or amitriptyline groups. The average number of side effects was higher in the amitriptyline group compared with other groups. Conclusions Memantine appears to be an effective and safe medication for protracted withdrawal (SA) and relapse prevention in recently detoxified heroin addicts. These data provide a rationale for further studies on the use of memantine in heroin dependence treatment.