BackgroundMental health problems and impaired sexual function are widely reported among those suffering from drug abuse, particularly among those under methadone maintenance therapy (MMT).AimsThe current study aimed to, firstly, investigate the effect of melatonin and zolpidem on mental health and sexual function of those with drug abuse under MMT, and, secondly, to compare the effects of melatonin and zolpidem on the studied outcomes.MethodsThe current randomized, single-blind, placebo-controlled clinical trial was conducted on 98 participants who were randomly assigned into three groups of melatonin (n = 34), zolpidem (n = 32), and placebo (n = 32). All participants received the intervention once a day for 30 days, without changes in nutrition. Mental health and sexual function were measured before and 30 days after the intervention.ResultsThe mean age of participants in the groups of melatonin, zolpidem, and placebo was 35.8 ± 9.6 years (22â58 years of old), 35.9 ± 9.3 years (21â58), and 37.2 ± 7.8 years (26â53), respectively. Sexual function mean score was significantly increased from 38 to 41 in the melatonin group, while it deceased in zolpidem (from 39.1 to 38) and placebo (39.25â38.59) groups. Also, mental health mean scores improved statistically significantly in the melatonin group (from 60.65 to 43.56; p = 0.002), and descriptively in the zolpidem group (57.88â51.18; p = 0.129). Concerning both outcomes, the observed improvement was considerably higher in the melatonin group. The highest improvement was observed in dimensions of overall satisfaction and depression in the melatonin group (1.18 and â8.4, respectively).ConclusionMelatonin could significantly improve both mental health and some domains of sexual function of those with drug abuse under MMT, while zolpidem did not show a significant effect.Trial Registration Numberhttps://www.irct.ir/trial/53047, identifier: IRCT20201214049718N1.