Scientists might one day be able to treat phantom limb pain with engineering instead of drugs.

When people lose a limb or a piece of one, they often experience pain that appears to originate from the body part that is missing. “It can feel like a variety of things, such as burning, twisting, itching or pressure,” the Amputee Coalition explains. The phantom pain can last anywhere from minutes to years after an amputation. And those amputations, which affect about 2 million people in the U.S., are not just caused by trauma, but also result from cancer, diabetes and other diseases.

There may be hope, however, for people with the chronic — and largely untreatable — pain condition. A study published in Nature Communications suggests rewiring in the brain is what causes the phantom pain and that it can be alleviated with the help of artificial intelligence.

Related: Scientists Can Make Non-Amputees Feel 'Phantom Limb' Sensation [VIDEO]

The faulty wiring in the brain that causes phantom limb pain is believed to take place in the sensorimotor cortex, where the brain processes both sensory input and movement — “in other words, there is a mismatch between a movement and the perception of that movement,” according to a statement from the University of Cambridge. So researchers from that institution in England and from Japan’s Osaka University looked at the brain activity necessary for someone to “move their phantom hand” and then put that information into a robotic prosthetic hooked up to the patient’s nervous system. They found that the more skilled the 10 subjects became at mentally controlling the prosthetic, the worse the pain got, because expected sensory information resulting from the movement was not being delivered to the brain. But when the patients’ brains were trained to control the prosthetic in the same way they would control the limb that is still present — for instance, treating the missing left hand in the same way it treats the attached right hand — the pain decreased substantially.

The study says tricking the brain in this way is playing on its adaptability, emphasizing that it was not restoring motor function that eased the pain but rather the brain’s ability to learn and change. That finding could be important in helping those with phantom limb pain, which occurs in the large majority of amputations.

“Even though the hand is gone, people with phantom limb pain still feel like there’s a hand there — it basically feels painful, like a burning or hypersensitive type of pain, and conventional painkillers are ineffective in treating it,” study co-author Ben Seymour, a neuroscientist based in Cambridge’s Department of Engineering, said in the university statement. “But the results demonstrate that combining [artificial intelligence] techniques with new technologies is a promising avenue for treating pain.” He expressed hope that such a treatment for phantom limb pain could be developed in the next several years.

There are not many other solutions for sufferers. The study notes that painkillers are not always effective, nor is mirror therapy, in which the patient uses a mirror reflection of an intact limb to trick the brain into seeing the missing one as if it is still connected.

Another new idea for treating the condition includes rewiring nerve endings in a patient’s stump and then attaching a prosthetic limb that uses sensors to interact with them.

As far as the new findings go, the researchers suggest the engineering treatment can help more than just amputees — the University of Cambridge statement said the method could be applied to other sources of chronic pain, such as arthritis.

“Ideally, we’d like to see something that people could have at home, or that they could incorporate with physio treatments,” Seymour said in the statement.

Source: Yanagisawa T, Fukuma R, Seymour B, et al. Induced sensorimotor brain plasticity controls pain in phantom limb patients. Nature Communications. 2016.