Children who are anxious or depressed are more likely to use ecstasy when they are older, a study has suggested.
Clubbers began using ecstasy in the late 1980s
Dutch scientists studied 1,500 children with an average age of nine, in 1983.
When they went back 14 years later, those who had shown signs of anxiety or depression as children were found to be at an increased risk of using the drug.
The research, published in the British Medical Journal, said depressed people may take the drug to feel better, but warns it is likely to make them worse.
For some time, scientists have been aware that using ecstasy is associated with emotional health problems, such as depression, psychotic symptoms, and anxiety disorders.
But it was not clear whether emotional problems were caused by using ecstasy, or if they led to ecstasy use.
The team of researchers from the Erasmus Medical Centre in Rotterdam looked at the 1,580 children as part of a long-term population study.
All were aged between four and 17 when they were first assessed in 1983 - before ecstasy began to be used as a recreational drug in the Netherlands.
The researchers used scientific checklists to assess if the children had any of 120 emotional or behaviour problems, such as being withdrawn, having attention problems or being aggressive.
The study participants were followed up in 1997, when they were aged between 18 to 33.
It was found that individuals who had shown signs of anxiety and depression as children in 1983 showed an increased risk of starting to use ecstasy.
People with these conditions may be particularly susceptible to ecstasy's effects including enhanced feelings of bonding with other people, euphoria, or relaxation, hoping they can alleviate their symptoms, the researchers say.
But they add that long-term use of the drug has previously been found to lead to an increased risk of depressive symptoms.
So people who are trying to make themselves feel better may, in the long-run, end up feeling worse.
The Erasmus researchers say there were factors they did not take into account such as the individual's social environment, their desire for novel experiences, substance use by their parents or the effects of using other drugs - which was common among those who used ecstasy.
However, the team led by Professor Anja Huizink, of the Department of Child and Adolescent Psychiatry at Erasmus, said their findings did show a link between childhood anxiety and later ecstasy use.
They said: "Focusing on these vulnerable individuals in future studies will increase our insight into the potential harmful effects of ecstasy."
Martin Barnes, chief executive of DrugScope said: "The suggestion that young people with emotional health problems may use ecstasy to feel better is not surprising, particularly as the drug creates feelings of euphoria and emotional closeness to others.
"This is an important contribution towards understanding why vulnerable young people, and indeed adults, are more susceptible to drug use and misuse.
"The research does raise a question as to whether ecstasy use can cause longer-term mental health problems, but certainly does not rule this out."