Detection of benzyolecgonine, the major metabolite of cocaine, in the urinalysis conducted on the first day of an inpatient heroin detoxification treatment program was studied as a predictor of discharge against medical advice (AMA). With this aim, we conducted a chart-review procedure of 275 heroin dependents (DSM-III-R) who received methadone or dextropropoxyphene chlorhydrate to treat Opioid Withdrawal Syndrome. Data were analyzed following a case-control design. The 49 (17.8%) patients who did not complete the treatment due to discharged AMA were characterized by having achieved total heroin abstinence during fewer months from the time they began consumption of this substance to the time of hospitalization (p = .001). Moreover, those patients who requested discharge AMA were characterized by more frequent detection of benzoylecgonine in their urine on the day of admission (p = .004). The value of the odds ratio of this association was 3.81 (95% CI; 1.30 to 11.04). Lastly, noncompleters due to discharge AMA were more likely to be single than ever married (p = .037). The logistic regression model confirmed that there is a significant relationship between an AMA event and the presence of benzoylecgonine in urine upon beginning detoxification and to a shorter duration of the period of total heroin abstinence. In the discussion, the influence that recent interruption of cocaine consumption has on the decision to drop out of a detoxification program AMA is considered.