Albert Hofmann, the Swiss chemist who discovered the hallucinogenic drug LSD, has died aged 102.

Hofmann, who advocated the medicinal properties of the drug he termed his "problem child", died from a heart attack at his home in Basel, Switzerland on Tuesday, the California-based Multidisciplinary Association for Psychedelic Studies (MAPS) said on its website today.

Born January 11th, 1906, Hofmann discovered LSD -- which later became the favoured drug of the 1960s counter-culture -- when a tiny quantity leaked on to his hand during a laboratory experiment in 1943. He noted a "remarkable restlessness, combined with slight dizziness" that made him stop his work.

"At home I lay down and sank into a not unpleasant intoxication-like condition, characterised by an extremely stimulated imagination," Hofmann said of the experience.

"In a dreamlike state, with eyes closed (I found the daylight too unpleasantly glaring), I perceived an uninterrupted stream of fantastic pictures, extraordinary shapes with intense, kaleidoscopic play of colours," Hofmann wrote in his book "LSD -- My Problem Child."

"After some two hours this condition faded away."

A few days later Hofmann intentionally took a 250-milligram dose of LSD and experienced the world's first "bad trip" -- slang for when the user suffers a disturbed reaction.

"On the way home, my condition began to assume threatening forms. Everything in my field of vision wavered and was distorted as if seen in a curved mirror," he said.

Once home, the LSD continued to warp Hofmann's mind: "My surroundings had now transformed themselves in more terrifying ways," he wrote. "Everything in the room spun around, and the familiar objects and pieces of furniture assumed grotesque, threatening forms."

The former Harvard lecturer Timothy Leary popularised LSD with his "turn on, tune in, drop out" advice in the 1960s, but Hofmann believed the substance was hijacked and abused by the hippy movement and maintained he produced it as a medicine.

Hofmann believed it could still serve a valid purpose in medicine, as it did for Aldous Huxley, author of "Brave New World" who used the drug to ease his final suffering.

Hofmann -- who believed LSD was useful in xxxysis of how the mind works, hoping it could be used to recognise and treat illnesses like schizophrenia -- defended his "wonder drug" for decades after it was banned in the 1960s.