After states pass laws permitting medical marijuana, drivers in those states become less likely to test positive for opioids after fatal car accidents, a new study from Columbia University's Mailman School of Public Health has found.

Researchers analyzed federal crash data in 18 states over the period from 1999 to 2013. States that passed a medical marijuana law during this period saw a reduction in opioid involvement in fatal car accidents, relative to states without such a law. The reduction was greatest among drivers aged 21 to 40, the age group most likely to use medical marijuana where it's available.

"We would expect the adverse consequences of opioid use to decrease over time in states where medical marijuana use is legal, as individuals substitute marijuana for opioids in the treatment of severe or chronic pain," said June H. Kim, a doctoral student at the Mailman School of Public Health, and the study's lead author, in a press release.

The study, published Thursday in the American Journal of Public Health, is the first to look at the relationship between medical marijuana laws and individual-level laboratory measurements of opioid use. The results suggest a fairly straightforward conclusion that "in states with medical marijuana laws, fewer individuals are using opioids," the authors write.

It adds to a growing body of evidence suggesting that chronic pain patients may substitute marijuana for prescription painkillers in states where the option is available.

One paper published earlier this year found that Medicare Part D prescriptions for painkillers declined significantly in states that passed medical marijuana laws. Other studies have shown that medical marijuana states see fewer painkiller overdose deaths than states without medical pot, and that access to medical marijuana dispensaries is also linked to declining rates of opiate overdose and death.

In a sign some drugmakers might be worried about marijuana's impact, the company behind the powerful painkiller fentanyl recently poured half a million dollars into the campaign opposing full marijuana legalization in Arizona, one of the biggest-ever single donations to an anti-legalization cause.

Medical marijuana is currently legal, with varying degrees of restriction, in 25 states plus the District of Columbia. Still, the federal Drug Enforcement Administration earlier this year refused to relax restrictions on marijuana, claiming that the drug has no medically accepted use.

The DEA is also moving to increase restrictions on another natural drug, kratom, that some opiate addicts say they have used to kick their painkiller habit.

In 2014, painkiller overdoses killed nearly 19,000 people, according to the CDC. According to the DEA, no overdose death from marijuana has ever been recorded.