While ketamine has been doing wonders as an antidepressant, researchers have discovered something concerning about the way it may actually be working on patients' brains.

New research has linked the drug's effects to the brain's opioid system – meaning it potentially acts as an opioid like morphine or oxycodone, but in a different form.

The latest study confirms ketamine's effectiveness in treating depression, but the researchers say the drug's use as an antidepressant might have to be limited, because the biological triggers it pulls could cause problems further down the line.

Specifically, opioid addiction, a reliance upon painkillers that has already reached crisis levels in the US. Ketamine was previous thought to act solely on the glutamate system in the brain, but this new study tells a different story.

"Before we did the study, I wasn't sure that ketamine really worked to treat depression," says one of the researchers, Alan Schatzberg from the Stanford University School of Medicine in California.

"Now I know the drug works, but it doesn't work like everyone thought it was working."

The FDA (Food and Drug Administration) hasn't approved ketamine for the treatment of depression, but some doctors have been prescribing it as a fast, short-term fix, even though its effects on depression in the brain weren't fully understood. And what we just learned is big.

In a small-scale experiment, 12 volunteers who had previously struggled to find effective treatments for their depression were twice given a dose of ketamine, with a two-week gap – once after being given the either the opioid blocker naltrexone, and once after being given a placebo.

Results showed the symptoms of depression vastly improved in the placebo test, but not the naltrexone test. That suggests ketamine is working on the brain's opioid receptors.

"We would hate to treat the depression and suicide epidemics by overusing ketamine, which might perhaps unintentionally grow the third head of opioid dependence," says neuroscientist Mark George from the Medical University of South Carolina, who wrote an accompanying editorial on the new research.

The researchers suggest that ketamine could still be useful as an antidepressant – it is remarkably effective, after all – but that it should be used carefully.

"I think it's a very interesting paper," Yale University psychiatrist Gerard Sanacora, who wasn't involved in the study, told Wired. "It does highlight that there are probably many factors that influence how ketamine is producing its antidepressant-like effect."

The link could also help scientists better understand the connection between depression and pain – depression and opiate use often go hand-in-hand, and understanding that relationship is going to be important in breaking the cycle. With the opioid epidemic accounting for around 49,000 deaths last year in the US alone, time is of the essence.

There are limitations to the study, including the small number of people involved. The research doesn't necessarily prove that ketamine is working through the opioid system, either – it might be that the drug just requires these brain receptors to be operational.

It's also possible that ketamine is just releasing endorphins in the brain, much like an opioid would, rather than acting on the opioid receptors directly. Further research is needed to figure out what's going on, but for now scientists are recommending caution.

"With these new findings, we should be cautious about widespread and repeated use of ketamine before further mechanistic testing has been performed to determine whether ketamine is merely another opioid in a novel form," says George.

The research has been published in the American Journal of Psychiatry.