The psychedelic drug LSD was first synthesized by the Swiss chemist Albert Hofmann in the Sandoz (now Novartis) laboratories in Basel, Switzerland in 1938. It wasn't until 5 years later on April 16th, 1943, that the psychedelic properties were discovered.
The Sandoz laboratory had undertaken a research program aimed at isolating the active constituents of medicinal plants so that they could be produced in the laboratory and later precisely dosed for accurate administration to patients. Dr. Hofmann eventually began researching the ergot fungus and alkaloids which could be derived from it. Ergot was traditionally used by midwives as an ecbolic, a medication used to induce childbirth, and early 20th century research indicated that the various compounds in ergot had other effects on the body as well, prompting further research.
After Dr. Hofmann succeeded in synthesizing ergobasine (which became the preeminent uterotonic), he began experiments with other molecules based around the central lysergic acid component shared by ergot alkalines. Lysergic acid diethylamide, the 25th lysergic acid derivative he synthesised (hence the name LSD-25) was developed initially as a probable analeptic, a circulatory and respiratory stimulant, based on its structural similarity to another known analeptic, nikethamide (nicotinic acid diethylamide). However, no extraordinary benefits of the compound were identified during animal tests (though laboratory notes briefly mention that the animals became "restless" under its effects), and its study was discontinued.