A study of more than 25,000 people under community corrections supervision suggests the use of psychedelic drugs like LSD can keep people out of prison.

The research is the first in 40 years to examine whether drugs like LSD and “magic” mushrooms can help reform criminals.

“Our results provide a notable exception to the robust positive link between substance use and criminal behavior,” the researchers from the University of Alabama at Birmingham and Johns Hopkins University School of Medicine wrote in their study, which was published in the January issue of the Journal of Psychopharmacology.

“They add to both the older and emerging body of data indicating beneficial effects of hallucinogen interventions, and run counter to the legal classification as well as popular perception of hallucinogens as categorically harmful substances with no therapeutic potential.”

Psychedelic substances piqued the interest of researchers beginning in the 1950s. Studies indicated that the drugs could be combined with psychotherapy to treat a number of conditions, including alcoholism and drug addiction.

But scientific investigations into the therapeutic potential of LSD, psilocybin, mescaline, and other psychedelic drugs ground to a halt in the 1970s, when they were outlawed by the federal Controlled Substances Act.

“Offenders may be especially likely to benefit from hallucinogen treatment because involvement in the criminal justice system often results from drug-seeking behavior and impulsive conduct exacerbated by compulsive substance use,” the researchers explained in the study.

From 2002 to 2007, the researchers collected data on 25,622 individuals under community corrections supervision in Treatment Accountability for Safer Communities (TASC), a program for individuals with a history of drug abuse.

Only about 1 percent of those in the program were diagnosed with a hallucinogen use disorder. Cannabis use disorders, cocaine use disorders, and alcohol use disorders were the most common diagnoses in the group.

The researchers found those diagnosed with a hallucinogen use disorder were less likely to fail the TASC program compared to those without a hallucinogen use disorder. That means those with a hallucinogen use disorder were less likely to violate TASC rules or other legal requirements, less likely to fail to appear in court, and less likely to be incarcerated.

The study controlled for a large number of potentially confounding factors, including race, employment, marital status, age, criminal history, drug abuse history, gender, educational attainment, and more.

“The current findings should not at all be interpreted as advocating for recreational hallucinogen use. Nevertheless, they demonstrate that, in a real-world, substance-related intervention setting, hallucinogen use is associated with a lower probability of poor outcome,” the researchers wrote.

“We believe this calls for the continued scientific investigation of this unique class of substances.”

The study was authored by Peter S. Hendricks, C. Brendan Clark, Matthew W. Johnson, Kevin R. Fontaine, and Karen L. Cropsey.