Pain vanished for at least three months in rats who were injected in the spine with a gene that triggers endorphins, the body's natural pain killer.
The therapy did not affect the rest of the nervous system, including the brain, potentially preventing the main side-effects of current pain relief.
Studies suggest drugs do not relieve cancer pain in as many as 66% of cases.
The research appeared in the Proceedings of the National Academy of Sciences.
"Chronic pain patients often do not experience satisfactory pain relief from available treatments due to poor efficacy or intolerable side effects like extreme sleepiness, mental clouding and hallucinations," said Andreas Beutler, part of the team who conducted the study at Mount Sinai School of Medicine in New York.
He said that in some circumstances, patients preferred to continue suffering some pain in order to preserve lucidity.
There is also a potential risk of addiction to opiate drugs.
The team used a disabled cold virus to carry the gene into the spinal fluid of the rats, which had been developed to suffer from chronic pain.
By blocking the pain impulses travelling up to their brains, the rats remained pain-free for at least three months, the researchers wrote.
"Although this research is at a very early stage, the concept of using gene therapy to deliver pain relief is interesting because it could potentially have fewer side effects than conventional pain relief," said Josephine Querido of Cancer Research UK.
But while cancer patients could be among the main beneficiaries of such a technique, a recent European study suggested that as many as 20% of adults suffer from chronic or intermittent pain for which no satisfactory treatment has been found.
Chronic back pain in the UK alone is thought to cost billions.
Scientists have been trying for many years now to harness gene therapy for pain relief but have hit various problems.
This development is "certainly exciting and promising", says Professor Turo Nurmikko, Director of the Pain Research Institute in Liverpool.
"But it is a little too early to say what the ultimate significance of the results is.
"Once the researchers have shown that in animal models of chronic pain, there is long-standing improvement, one could start speaking of a medical breakthrough."