One of the most controversial drugs developed in the last century was LSD, the full name being lysergic acid diethylamide. It wasn't really discovered accidentally. Albert Hoffman, the man, who synthesized the substance, clarifies it in his book "LSD — My Problem Child":
Time and again I hear or read that LSD was discovered by accident. This is only partly true. LSD came into being within a systematic research program, and the "accident" did not occur until much later: when LSD was already five years old, I happened to experience its unforeseeable effects in my own body-or rather, in my own mind.
So here's the full story. In 1930s, when he was working for the pharmaceutical-chemical department of Sandoz Laboratories, Hoffmann began studying the medicinal plant squill and the fungus ergot. The objective of his research was to purify and synthesize active components of the samples to be used in pharmaceuticals. The researcher was hoping to create a respiratory and circulatory stimulant (or analeptic) based on the synthesized substances. He hoped to be successful with LSD-25 — the 25th substance in the series of the lysergic acid derivatives — its structure was similar to analeptics already known at the time. After testing, the hopes were shattered — pharmacologists and physicians failed to find sought-after results in animal test subjects. The substance was shelved for five years. The research Hoffman did in these years eventually convinced him to submit another sample of LSD-25 for further testing. When he was synthesizing the already-familiar compound, he made one serious mistake — he touched it with his fingertips. He did not know the substance could be absorbed through skin this way, and thus normal safety procedures were not sufficient. In his own words, he "felt affected by a remarkable restlessness, combined with a slight dizziness…[he] laid down and sank into a not unpleasant intoxicated-like condition…"
What happened afterwards is known in history as the Bicycle Day. Intrigued by the unexpected experience, three days after the accidental exposure to LSD, on April 19, 1943, Hofmann intentionally ingested 250 micrograms of the substance. After feeling definitely something, he decided he should go home.
I asked my laboratory assistant, who was informed of the self-experiment, to escort me home. We went by bicycle, no automobile being available because of wartime restrictions on their use. 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. I also had the sensation of being unable to move from the spot. Nevertheless, my assistant later told me that we had traveled very rapidly. Finally, we arrived at home safe and sound, and I was just barely capable of asking my companion to summon our family doctor and request milk from the neighbors.
Hoffman then describes the effect of LSD had on his perception, shifting from terrifying to enjoyable. After the effect wore down, the scientist realized that the drug had potential as a powerful psychiatric tool. Interestingly, Hoffman could not imagine anyone using LSD recreationally due to its intense and introspective nature. After this discovery, LSD has eventually found application in psychiatrics. Official LSD production was eventually halted in 1965 after growing recreational use and governmental protests.
As of 2014, however, new studies began to appear which indicated that LSD may, in fact, have therapeutic benefits.