This week, Attorney General Jeff Sessions paused a discussion of the opioid epidemic to, once again, go after marijuana. He suggested that addictive pain medication wasn’t the only problem and that many heroin addicts start out “with marijuana and other drugs.”

There is a relationship between cannabis and opioids, but Mr. Sessions has it backward. Marijuana isn’t a gateway drug to opioid addiction; it’s a safer alternative to pain medicines. Mr. Sessions’s vow to crack down on marijuana will only make the opioid epidemic worse.

We know that 40 percent of all opiate overdose deaths involve a prescription opiate. So having legal access to cannabis as another option for pain relief may actually reduce consumption of opiates.

I know it sounds counterintuitive, but consider the evidence. To start, a large study assessed the effect of medical-marijuana laws on opiate-related deaths between 1999 and 2010 in all 50 states and reported a 25 percent decrease in opiate overdose mortality in states where medical marijuana was legal, compared with those where it wasn’t. The study found that in 2010, medical-marijuana laws resulted in an estimated 1,729 fewer deaths than expected.