U.S. Attorney General Jeff Sessions recently said he was “astonished” by claims that legal marijuana could solve the opioid crisis devastating the nation. However, a new study firmly linked legalized weed to decreased opioid abuse and overdoses.

After analyzing hospitalization records from 1997 to 2014 in 27 states, nine of which legalized medical marijuana within that timeframe, researchers from the University of California San Diego found hospitalization rates of people suffering from painkiller abuse and addiction dropped on average 23 percent in states that offered medical marijuana. Opioid overdose cases at hospitals in states with legal weed also dropped by an average of 13 percent, the study said.

The study, which was released in the Drug and Alcohol Dependence report, said the findings prove that fears of legal marijuana driving hospitalizations upward were unsubstantiated.

“Medical marijuana laws may have reduced hospitalizations related to opioid pain relievers,” Yuyan Shi, the study’s author and University of California San Diego public health professor, told Reuters Monday. “This study and a few others provided some evidence regarding the potential positive benefits of legalizing marijuana to reduce opioid use and abuse, but they are still preliminary.”

There have been other studies that have analyzed the connection between medical marijuana and reduced opioid prescriptions, including one published in the journal JAMA Internal Medicine in 2014 that found a 25 percent decrease in opioid overdose deaths in states with legal medical marijuana.

The findings appear to go hand-in-hand with another more recent study, released in the July 2016 issue of Health Affairs journal, which found doctors in medical marijuana states prescribed 1,800 fewer painkiller prescriptions for patients a year.

More than 33,000 U.S. residents died from an opioid-related overdose in 2015, according to the Centers for Disease Control. Marijuana, which the federal government still classifies as a Schedule I substance, has yet to be linked to any fatal overdoses.