Six days before Prince died, the iconic pop star was hospitalized after possibly overdosing on Percocet. His death on April 21 involved overdosing on another painkiller, fentanyl. Both are among the prescription opioids that alleviate the pain of millions of Americans every year—often at the price of their needing ever greater amounts and the risk of overdose. The U.S. “is in the midst of an unprecedented opioid epidemic,” according to the Department of Health and Human Services. Prescription opioid overdoses killed more than 165,000 Americans between 1999 and 2014, and the health and social costs of abusing such drugs are estimated to be as much as $55 billion a year. The problem has led experts to scramble for a less dangerous alternative for pain relief—and some research points to medical marijuana.

As early as 15 years ago physicians began hearing that patients were using cannabis instead of prescription opioids for pain. These anecdotes inspired a research team led by Marcus Bachhuber, assistant professor of medicine at the Montefiore Medical Center in New York City, to examine whether some states' legalization of medical cannabis had affected the number of opioid overdose deaths. Published in 2014, the study revealed an intriguing trend: between 1999 and 2010, states that permitted medical marijuana had an average of almost 25 percent fewer opioid overdose deaths each year than states where cannabis remained illegal.

Bachhuber's research could not prove that medical cannabis use directly led to fewer opioid overdoses. In addition, the overdose count included both prescription opioids and illegal heroin. But the study opened the eyes of many researchers to a possible relation between marijuana and painkiller use. “I think medical cannabis could fall into the category of alternatives for treating chronic pain so that people don't use opioids or use a lower dose of opioids than they otherwise would,” Bachhuber says.

Various wide-ranging new studies back him up. As reported in the June issue of the Journal of Pain, researchers at the University of Michigan conducted a retrospective survey of 185 patients who frequented a medical marijuana dispensary in Ann Arbor, Mich. Those patients reported cutting their opioid use by more than half in treating their chronic pain. Meanwhile animal studies have shown that cannabinoid chemical compounds found in marijuana can work synergistically with opioids to mitigate pain.

Medical cannabis was also a hot topic at the 2016 meeting of the American Pain Society, says Simon Haroutounian, chief of clinical research at the Washington University Pain Center in St. Louis. He co-authored a study, published online in February in the Clinical Journal of Pain, that followed a group of 176 chronic pain patients in Israel over seven months and found that 44 percent of them stopped taking prescription opioids within seven months of starting medical cannabis. The research is among several recent observational studies showing an association between medical cannabis use and decreased dependence on opioids.

Each of these analyses has its limitations. Retrospective studies cannot reveal crucial details such as whether overdose deaths involved patients who were using medically prescribed opioids or people who got the drugs illegally and were using them recreationally or to self-medicate. And although Haroutounian's observational study was carried out in real time, the participants were prescreened for psychiatric conditions and the potential for drug misuse. That means they were less likely to suffer complications from medical cannabis than a general population of chronic pain patients. “We don't have good data on the long-term effects and in larger populations that are not so carefully selected,” Haroutounian explains.

As for the safety of medical marijuana as an opioid alternative, one of the most extensive reports to date was published late last year in the Journal of Pain and followed about 200 patients using cannabis for chronic pain over 12 months. Unlike most previous research, this study directly compared medical cannabis users with a control group of chronic pain patients who did not use the drug. The results showed some increased risk for nonserious adverse effects in the medical cannabis group but no difference in the risk of serious adverse events.

Studies that specifically examine whether cannabis can substitute for opioids in providing pain relief have been limited to just a few hundred patients at most. But the largest observational study yet is already underway. Tilray, a Canadian producer of cannabis products, has backed the 1,000-patient study that extends across 20 Canadian clinics and covers a total of six months. "Most research has mostly relied on patient self-reporting, which is great and useful," says Philippe Lucas, vice president of patient advocacy at Tilray. "But we really need to study the substitution effect in real time."

Experimental clinical trials would provide the most definitive proof on any cause-and-effect relation between medical cannabis and reduced opioid use, says Mark Ware, director of clinical research at the Alan Edwards Pain Management Unit at McGill University and lead author of the Journal of Pain safety study. But experimental research with medical cannabis remains difficult because the U.S. classifies it as a Schedule I substance that has “no currently accepted medical use and a high potential for abuse.” Most other countries have similar restrictions, which pose challenges for researchers to legally obtain cannabis or to get approval for clinical trials.

Such trials are also a necessary next step because they would help determine safety. All experts interviewed for this article see medical cannabis as a potentially viable treatment option for chronic pain, but many also worry about rushing ahead without a better understanding of the long-term effects of marijuana—which carries its own risks of substance abuse and unwanted side effects.

“We have all these states that have legalized medical cannabis,” says Kevin Boehnke, a Ph.D. candidate in environmental health sciences and public health at the University of Michigan and co-author on the Ann Arbor study. “At this point, we really need a policy on the ways that cannabis can be researched and accessed by the scientific community to catch up with that reality.”

Political attitudes toward cannabis have recently been shifting fast. On June 8, Ohio joined 24 other states and the District of Columbia in legalizing medical cannabis. The U.S. Drug Enforcement Administration spent much of the year mulling over two state governors' petitions to reconsider marijuana’s Schedule I status, but ultimately denied the petitions in an August 11 decision. Still, the agency announced a policy change that could encourage U.S. research by boosting the number of authorized marijuana manufacturers.

Medical cannabis is unlikely to prove a replacement for opioids in all medical situations. For example, prescribing opioids is relatively uncontroversial in end-of-life care and in treatment of acute pain from cancer, major surgery or broken bones. But for pain not caused by cancer, medical cannabis may prove a better candidate in the long run. Even the most severe critics, Bachhuber says, would accept that medical cannabis is safer than opioids when it comes to the risk of fatal overdose.

Editor’s Note (8/16/16): This article from our print edition was updated for posting online to reflect the August 11 decision by The U.S. Drug Enforcement Administration.