A number of studies have shown that people dealing with chronic pain issues find themselves substituting medical marijuana for prescription painkillers. And according to new research out this week, they’re also using cannabis to replace opioids that weren’t prescribed by a doctor, such as heroin.

“We observed an independent negative association between frequent cannabis use and frequent illicit opioid use among [people who use drugs, or PWUD] with chronic pain,” the authors write. “These findings provide longitudinal observational evidence that cannabis may serve as an adjunct to or substitute for illicit opioid use among PWUD with chronic pain.”

Patients who have under-treated or undiagnosed pain often turn to substances outside of their prescribed medications to help them manage. Because this population is at serious risk for opioid overdose, researchers at the University of British Columbia and McGill University in Canada, as well as the University of California, Los Angeles, set out to use individual-level data to understand whether marijuana serves as a potential substitute for these illicit substances.

For their analysis, which was published in PLOS Medicine, the study’s authors used information from two open prospective cohort studies of people who consume drugs in Vancouver, Canada, and included 1,152 individuals who reported feeling serious or persistent pain at some point between 2014 and 2017.

“We found that people who used cannabis every day had about 50% lower odds of using illicit opioids every day compared to cannabis non-users.”

Over the study period, 455 people reported using heroin or other illicit pharmaceuticals daily throughout at least one of the six-month follow-up periods in the cohort studies. Meanwhile, 410 said they used cannabis daily. At the time of their initial interview when chronic pain was first reported, 583 participants said they were using marijuana either daily or occasionally, while 269 said they were using non-medical opioids every day.

Using a statistical model, researchers found that “daily cannabis use was significantly and negatively associated with daily illicit opioid use.”

“In this longitudinal study examining patterns of past-6-month frequency of cannabis and illicit opioid use,” the paper states, “we found that the odds of daily illicit opioid use were lower (by about half) among those who reported daily cannabis use compared to those who reported no cannabis use. However, we observed no significant association between occasional cannabis use and daily opioid use, suggesting that there may be an intentional therapeutic element associated with frequent cannabis use.”

In fact, a significant number of participants said they used cannabis regularly to address pain (148), sleep (144), stress (127) and nausea/loss of appetite (123).

The findings support a long-held belief by legalization advocates: Increasing access to marijuana could help mitigate the opioid crisis. “In the context of the current opioid crisis and the recent rollout of a national regulatory framework for cannabis use in Canada, frequent use of cannabis among PWUD with pain may play an important role in preventing or substituting frequent illicit opioid use,” the study points out.

Of course, it’s not as simple as it sounds. Underscoring the nuance of these complex issues, lead author Stephanie Lake, a PhD candidate at the University of British Columbia’s school of population and public health, tweeted on Tuesday: “Our study adds to the mix of findings about this ‘substitution’ effect. Formal clinical trials using cannabinoid-based therapies in the mgmt of pain, including among people who use drugs, are needed to further elucidate the effectiveness and feasibility of cannabis for pain.”

She continued: “Is cannabis a silver bullet for pain management and harm reduction among people who are in pain and at high risk of overdose? Nope. Are opioids bad? No. Should we consider cannabis-based strategies as one of many tools to reduce harm? Yes.”