A study released earlier this week shows that between 1999 and 2010, the 13 states which legalized medical marijuana saw deaths from opioid overdoses drop by 25 percent.

“The difference is quite striking,” Colleen Barry, co-author of the study and a health policy researcher at Johns Hopkins Bloomberg School of Public Health, told Newsweek. Barry also said that the drop happened quickly and was noticeable the year after medical marijuana was legalized in each state.

The study, published in JAMA Internal Medicine, hypothesizes that patients in states where medical marijuana is allowed are replacing opioids like Vicodin and OxyContin with cannabis, or are at least using the plant to supplement opioid use, reducing their dosage to a level that is less likely to lead to a problem.

According to the Centers for Disease Control and Prevention (CDC), 46 people in the US die every day from an overdose of prescription painkillers. In 2012, healthcare providers wrote 259 million prescriptions for narcotic painkillers, “enough for every American adult to have a bottle of pills.”

Former US Surgeon General Joyce Elders wrote in the Providence Journal that:

“marijuana can relieve certain types of pain, nausea, vomiting and other symptoms caused by such illnesses as multiple sclerosis, cancer and AIDS — or by the harsh drugs sometimes used to treat them … with remarkable safety. Indeed, marijuana is less toxic than many of the drugs that physicians prescribe every day.”

Elders also said unlike prescription painkillers, “marijuana has never been proven to cause a fatal overdose,” a sentiment Barry agreed with, saying it was “basically impossible” to die from an overdose of marijuana.

Currently, 31 states and the District of Columbia legally allow some form of cannabis use for medical purposes. Possession of small amounts cannabis has been decriminalized in 16 states and made legal for non-medical use in Colorado and Washington. Alaska and Oregon will both vote on full legalization in November; Florida also will vote on a constitutional amendment to allow medical use.

Attitudes towards marijuana have changed greatly over the past few decades. In 2000, 31 percent of Americans supported legalization, a number that rose to almost 60 percent in 2013. Given its use for medical purposes and that it is less harmful than other legal substances like alcohol or prescription drugs, it’s no surprise that more and more states are starting change their laws.