“You can hear the Universal Symphony with God singing solo and Holy Ghost on drums,” was how Hunter S. Thompson described the experience, while the Beatles famously sang about “tangerine trees and marmalade skies”.

Scientists are still some way from understanding how LSD brings about altered states of consciousness, but they have finally identified why acid trips last so long.

A new study is the first to demonstrate precisely how the compound lysergic acid diethylamide (LSD) attaches to serotonin receptors in the brain.

The images reveal that once the LSD compound latches on, part of the serotonin receptor folds down over it like a dustbin lid, meaning that it is held tightly in place allowing the drug to linger in the brain for up to 12 hours.

Once the LSD compound latches on, part of the serotonin receptor folds down over it, allowing the drug to linger in the brain for up to 12 hours. Photograph: Wacker et al

Bryan Roth, a professor of pharmacology at University of North Carolina and a senior co-author on the study said: “It’s basically trapped in the receptor and can’t get out.”

Roth’s interest in the subject was sparked after witnessing the effects of LSD on fellow music fans at Grateful Dead concerts in his youth.

“It would be interesting to be in the parking lot hearing people wondering when their LSD experience was going to end,” says “A lot of people who take the drug are not aware of just how long it lasts.”

However, it has taken two decades of painstaking trial and error to manage to transform the LSD and receptor into a crystallised form. This allowed the scientists to decipher its exact physical structure, using crystallography, a technique where x-rays are beamed into a material and the resultant diffraction pattern can be used to work out the exact spacing of the atoms.

The study, published in Cell, also found that eventually brain cells respond to the attached molecule by sucking the receptor inwards, like a tortoise pulling its head into its shell, at which point the LSD is broken down.

In future, the findings could help chemists produce shorter-acting versions of the drug that may be more suited to clinical use for anxiety or post traumatic stress disorder