Researchers in Britain and the United States have found that the extreme pain of cluster headaches can be eased by electrodes.
Cluster headaches can cause excruciating bouts of pain which last for many hours which can be quite disabling.
Attacks recur frequently and many patients are forced to take preventive medication every day, but for some the drugs are ineffective.
In two separate studies researchers at the University College London in Britain and the University of California, San Francisco, found that stimulating the brain with implanted electrodes appeared to help ease the pain for sufferers.
One study found six out of eight patients had relief from cluster headaches, and two out of eight patients in a second study said they were headache-free for more than a year using the device, while three more reported a 90-percent drop in the frequency of attacks.
To date efforts to help sufferers have not been very successful and previous attempts at deep brain stimulation though effective proved to present a risk of fatal brain haemorrhage.
The researchers say this was because the therapy targeted a region called the posterior hypothalamus.
The researchers say it is important to target the correct area, the occipital nerve.
This latest attempt trialled a technique involving stimulation of the occipital nerve using electrodes implanted in their head and neck where the patients were given remote controls to adjust the pulses.
Though it took weeks or months before they noticed an improvement, after more than a year and a half, six of the eight said they would recommend the treatment to others.
The researchers say the symptoms returned almost immediately when the device's battery wore down and it stopped working.
Peter J Goadsby, a professor at the National Hospital for Neurology and Neurosurgery, in London, says occipital nerve stimulation in cluster headache seems to offer a safe, effective treatment option that could begin a new era of neurostimulation therapy for primary headache symptoms.
The studies are published in the Lancet medical journal and its sister publication Lancet Neurology.