The report below is based on research published in the journal Addiction. It appears there under the title The origin of MDMA (ecstasy) revisited: the true story reconstructed from the original documents. It is by Roland W Freudenmann, Florian Öxler and Sabine Bernschneider-Reif.

Sorted. More than two decades after the dance drug ecstasy burst on to the scene, chemists have finally pieced together the true story of the origins of one the most influential and controversial substances ever to come from a test tube.

According to popular history the drug, first discovered in 1912, was developed by the German pharmaceutical giant Merck as a lucrative way to suppress the appetites of soldiers in the German army - a plot foiled by reports of bizarre side effects among the first human guinea pigs. Merck, the story goes, was forced to withdraw the compound and consigned it to the pharmaceutical scrap heap, where it lay until resurrected by 1970s drug guru Alexander Shulgin.

This version of events appears regularly in medical reports, newspaper articles, textbooks and even on the official website of the US drug enforcement administration. But Merck has decided to set the record straight.

In an unusual step, the company got experts from its corporate history department and a local doctor to trawl through thousands of original documents in its archive at its headquarters in Darmstad.

For more than a year, they searched for references to ecstasy in laboratory journals, annual reports, patents, letters, interview records, memoirs and the other historical detritus thrown up by six decades of scientific research from 1900 to 1960.

Their verdict? The company did develop the drug in 1912, but the appetite suppressant story is an urban myth, passed on from source to source through "uncritical copy-paste procedures". Instead, documents from the time show that ecstasy emerged during the company's efforts to develop a potentially life-saving medicine that would help blood to clot.

The best available blood clot medicine at the time, hydrastinin, was patented by Merck's local rival Bayer. Merck chemists believed that a similar compound called methylhydrastinin would be equally effective and set about trying to make it from scratch in a way not covered by the Bayer patent. Ecstasy, also known as MDMA, was first produced during these experiments, but attracted little attention. Merck's recent search found just a passing reference to the drug: in a patent the company filed in 1912 to protect its new blood clot agent, which had been tested on patients in a Berlin hospital. Patent 274350 did not refer to MDMA by name, but described its properties among a list of other new intermediates: "colourless oil, boiling point 155C at 20mm pressure, its salt forms white crystals".

Tellingly, there were no references to any experiments to test the biological effects of ecstasy, then known as methylsafrylamin. As the official report of Merck's historical detectives puts it: "In clear contrast to what is usually claimed by the 'ecstasy' literature, MDMA was neither studied in animals nor humans at Merck around 1912."

This is not the first time that the appetite suppressant pill story has been exposed as false - Dr Shulgin and others have published more accurate accounts - but Merck hopes its rewriting of history will put the myth to bed. The false story probably started, the company says, because a US laboratory studied a similar compound called MDA as a possible diet drug between 1949 and 1957.

No one from Merck's corporate history department would comment, but a spokesman said the company had decided to act because it was regularly asked about its role in ecstasy's development. Its report appears this month in the journal Addiction.

What happened next? The Merck archive reveals that the company revived its interest in ecstasy in 1927, when the first tests were carried out on animals. The details have been lost, but it seems that a chemist called Max Oberlin had stumbled on the original patent and thought MDMA might mimic adrenaline because it had a similar structure.

Oberlin described the results of his tests as "partly remarkable" but the research was halted because of steep rises in the price of chemicals needed to make the drug. He recommended the company "keep an eye on this field". Further Merck tests in 1952 showed that the compound was toxic to flies. More controversial is the first testing on humans. The US air force is known to have carried out secret tests of MDMA and other drugs in the early 1950s. The experiments are often described as a search for a truth serum, but were carried out on animals, and it is more likely the military was searching for new chemical weapons.

The Merck archive suggests one of its scientists may have administered the first human tests in 1959. Wolfgang Fruhstorfer, a company chemist, was interested in the production of new stimulants and the report found "insinuations" that he had cooperated with an institute for aviation medicine. But it says: "Despite all efforts, it remains unclear whether he also investigated MDMA effects in humans."

By now, others had picked up the baton and run with it. A year later, in 1960, the first official recipe for ecstasy appeared in a scientific journal (in Polish) and by 1970 MDMA was cropping up in tablets seized in Chicago.

Dr Shulgin, a former scientist with the chemical company Dow, says he was told about the compound in the early 1970s. He synthesised the drug in 1976 and later tested it on himself - the first recorded human trials. His enthusiasm for the effects brought the drug to mainstream attention, for which he is often called the "godfather" of ecstasy. But the new Merck report reveals the drug's true heritage.

Buried in the archive, the Merck team found the original laboratory annual report for 1912, which describes the first synthesis, and names the scientists involved. The true father of ecstasy, the Guardian can reveal, was an anonymous German chemist called Anton Kollisch, who died in 1916 with no idea of the impact his legacy would have.

Timeline

1912 First synthesis of MDMA by Kollishch at Merck in Darmstadt

1970 First detection of MDMA in tablets seized in the streets of Chicago. By the mid-1970s the drugs expert Alexander Shulgin had begun to research its effects

1977 MDMA classified as a Class A drug in UK

1984 MDMA's street name of 'ecstasy' coined in California

1985 MDMA becomes a Schedule 1 controlled substance in the US

In the UK the street price of ecstasy is £25

Mid to late 80s Raves become increasingly popular, spreading out from the centres of London and Manchester

1989 Raves, and the electronic dance music and ecstasy, which fuels them, lead to a 'second summer of love'. Acid house, with the accompanying smiley-face T-shirts, goes mainstream and into the pop charts. This year also sees the first recorded ecstasy-related death in the UK

1994 Parts of the Criminal Justice and Public Order Act target raves, or gatherings with music which is characterised by 'a succession of repetitive beats'

1995 Death of Leah Betts after taking an ecstasy tablet on her 18th birthday

2003 6,230 people found guilty, cautioned or fined for ecstasy related offences

2005 In a survey of 500 Edinburgh students, 36% said they had taken ecstasy and of those, 75% considered ecstasy a 'positive force' on their lives

2006 The current street price is £3-8

Helen O'Brien