(Health.com) -- Terminally ill cancer patients struggling with anxiety may get some relief from a guided "trip" on the hallucinogenic drug psilocybin, a new study suggests.

The study included 12 patients who took a small dose of psilocybin -- the active ingredient in "magic mushrooms" -- while under the supervision of trained therapists. In a separate session, the participants took a placebo pill, which had little effect on their symptoms.

By contrast, one to three months after taking psilocybin the patients reported feeling less anxious and their overall mood had improved. By the six-month mark, the group's average score on a common scale used to measure depression had declined by 30 percent, according to the study, which was published in the Archives of General Psychiatry.

Can psychedelic drugs treat depression?

In follow-up interviews with the researchers, some patients said their experience with psilocybin gave them a new perspective on their illness and brought them closer to family and friends.

"We were pleased with the results," says the lead researcher, Charles Grob, M.D., a professor of psychiatry at Harbor-UCLA Medical Center, in Torrance, Calif.

Notably, the psilocybin did not aggravate the patients' anxiety or provoke any other unwanted effects besides a slight increase in blood pressure and heart rate.

Health.com: 7 types of therapy that can help depression

Grob's findings are "important because he's showing that you can administer these compounds safely to cancer patients with anxiety," says Roland Griffiths, Ph.D., a professor of psychiatry and neuroscience at the Johns Hopkins University School of Medicine, in Baltimore.

"They're not substances that should be used recreationally or casually, but nonetheless it appears that we can conduct research with these compounds safely," adds Griffiths, who was not involved in the study but has researched the therapeutic effects of psilocybin. (He and his colleagues are currently enrolling patients in a similar study that will use larger doses of the drug.)

Researchers investigating the therapeutic potential of psilocybin and other hallucinogens have been keen to demonstrate the safety of the drugs in clinical settings.

Health.com: Supplements for depression: what works

Psychiatrists and psychologists began exploring the effects of hallucinogens on the mood and anxiety of dying patients in the 1950s, but the research stopped abruptly when psilocybin, lysergic acid diethylamide (LSD), and other mind-altering drugs were outlawed in the 1970s.

The Food and Drug Administration (FDA) has approved a handful of small studies involving hallucinogens since the 1990s, but the field is still emerging.

Grob's study is the first of its kind in more than 35 years. It was funded by private foundations and the Heffter Research Institute, a nonprofit organization based in Santa Fe, New Mexico, that has been a major sponsor of the second-generation hallucinogen research.

The patients in the study were all close to death (10 of the 12 have since died), and they had all diagnoses of anxiety or acute stress relating to their prognosis.

"We were really looking for people who were really struggling with the predicament that they found themselves in," Grob explains.

Health.com: What an anxiety disorder feels like

During the psilocybin sessions, which lasted six hours, the patients lay on a couch and listened to music through headphones.

Although they spoke only briefly to the therapists while under the influence of the drug, they continued to meet periodically with the research staff for six months to discuss their experience and to fill out questionnaires assessing their mood and anxiety levels.

"I think we've established good grounds for continuing the research," Grob says. "That's the goal right now, just to develop more studies."

Copyright Health Magazine 2011