Animal models show that a single dose of 3,4-methylenedioxymethamhetamine (MDMA; 'ecstasy') can result in long-term disruption of sleep. We evaluated the relationship between ecstasy consumption and the use of sleep medications in humans after controlling for key factors. The Personality and Total Health Through Life project uses a longitudinal cohort with follow-up every 4 years. This study reports data from waves 2 and 3. Participants were recruited from the electoral roll in the Australian Capital Territory and Queanbeyan, New South Wales, Australia. Participants were aged 20-24 years at wave 1 (1999-2000). The study collected self-reported data on ecstasy, meth/amphetamine, cannabis, alcohol, tobacco and use of sleeping medications (pharmaceutical or other substances). Depression was categorized using the Brief Patient Health Questionnaire (BPHQ). Other psychosocial measures included life-time traumas. We used generalized estimating equations to model outcomes. Ecstasy data were available from 2128 people at wave 2 and 1977 at wave 3: sleeping medication use was reported by 227 (10.7%) respondents at wave 2 and 239 (12.1%) at wave 3. Increased odds ratios (OR) for sleeping medication use was found for those with depression [OR = 1.88, 95% confidence interval (CI): 1.39, 2.53], women (OR = 1.44, 95% CI: 1.13, 1.84), and increased by 19% for each life-time trauma. Ecstasy use was not a significant predictor, but ≥monthly versus never meth/amphetamine use increased the odds (OR = 3.03, 95% CI 1.30, 7.03). The use of ecstasy appears to be associated with the use of sleeping medications but this association can be accounted for by other factors.