Legalization of medical marijuana may reduce the instances of opioid use in adults under 40 years of age, a new study analyzing traffic accidents has suggested.

Published Thursday in the American Journal of Public Health, the study noted a fall in the use of opioid painkillers in states where medical marijuana was legal and easily accessible, as against states where it was tough to obtain, despite having medical marijuana laws in place. The medical use of marijuana is now legal in 25 states and Washington, D.C.

“After the implementation of a medical marijuana law, there appears to be less opioid use, at least among young and middle-aged adults,” June Kim, the study's lead author and a graduate student at Columbia University Mailman School of Public Health, said, according to HealthDay News.

The researchers used data from the Fatality Analysis Reporting System database of about 69,000 drivers from 18 states who died in auto accidents between 1999 and 2013. Tests for alcohol and other drugs had been conducted on the drivers.

In states where medical marijuana law was implemented, the study found that drivers between the ages of 21 — which is the legal minimum — and 40, had almost half the chances of testing positive for opioid painkillers, than those who crashed before such a law was implemented.

Opioid painkillers, like oxycodone (OxyContin) and hydrocodone (used in Vicodin and Vicoprofen), have been linked to widespread addiction and overdose deaths, according to medical officials.

“A study that came out a few years ago suggested that states with medical marijuana laws have a reduced rate of opioid overdoses,” Kim said. “I thought that if these laws were actually reducing overdoses, we should expect to see a similar reduction in opioid use.”

However, the methodology used by the authors of the study has been criticized by other experts in the field and the fact that the study did not prove medical marijuana was being used in place of opioids is an added disadvantage.

Jason Hockenberry, director of graduate studies with the Department of Health Policy and Management at Emory University went on to call the study “a bit of a mess,” HealthDay News reported.

Hockenberry also explained that “any benefits of medical marijuana need to be balanced against the negative effects of marijuana, which are not trivial. Our own work finds that abuse of marijuana and dependency are increasing in states with medical marijuana laws.”

HealthDay News also quoted Brendan Saloner, an assistant professor of Health Policy and Management at Johns Hopkins Bloomberg School of Public Health, saying that the sample of the study “is not necessarily generalizable to the population as a whole.”

“On the one hand, they could very well reduce harmful opioid use. But on the other hand, they could have offsetting effects on other risky behaviors including impaired driving,” Saloner said.