Scientists have raised the prospect that deep brain stimulation could help people suffering from severe anorexia nervosa.
In the small Canadian study three people were able to gain weight and had improvements in their overall mood after undergoing the procedure.
The researchers say larger trials are now needed to show whether this therapy could provide a last resort for people with difficult-to-treat anorexia.
The study is published in the Lancet.
Researchers from the Krembil Neuroscience Centre and University Health Network in Canada conducted the study primarily to find out whether this procedure is safe in people with severe cases of the eating disorder anorexia nervosa.
Deep brain stimulation - which involves implanting electrodes into the brain - has previously been used for people with Parkinson's disease, Alzheimer's disease and obsessive compulsive disorder.
'Flipping a switch'
But this is the first time researchers have implanted the device into brains of people with such severe forms of anorexia.
They treated six women, aged between 24-57, for whom most conventional therapy had failed.
The researchers chose to implant the electrodes in an area of the brain which influences how people regulate their mood and anxiety.
They then switched on the device to deliver continuous electrical stimulation over the nine months of the study.
Lead author of the research, Dr Nir Lipsman, said this was not a study about simply flipping a switch to make people eat more.
"Anorexia nervosa has many layers and we need to address the root causes. In many people with the condition this is related to difficulties in regulating mood and anxiety.
"So we wanted to see if influencing this area of the brain could help people with the condition," he said.
And after nine months three of the women felt their quality of life had improved and they had gained weight.
Crucially they were able to stick to this weight - something they hadn't been able to do since developing the condition, the researchers said.
Kim Rollins, who took part in the study and has suffered from anorexia nervosa for 20 years said: "It has really turned my life around. It has lifted my mood and lowered my anxiety... and lessened the compulsion I had to almost destroy my body.
"But it is not a miracle - I have to put a lot of work into changing my thinking and I go to therapy and see a dietitian. But it has enabled everything to be much easier for me."
Dr Lipsman said: "We think deep brain stimulation may have helped people view their illness in a different way and meant they felt more encouraged to engage in other therapy."
But the procedure was not without serious and unwanted effects.
One person involved had a seizure two weeks after the device was implanted and another suffered a panic attack during the operation to insert the device.
And for one person there were no improvements in mood, anxiety levels or weight by the end of the study.
The authors caution this procedure is not suitable for everyone.
"We worked very hard to identify a group of patients who had reached the limits of conventional treatment - for whom there is currently no effective therapy and therefore are at the greatest risk of death from the condition," Dr Lipsman said.
Prof Janet Treasure, of the Institute of Psychiatry, King's College London, who was not involved in the study but wrote a linked comment, said: "What we know is that if you can get effective treatment within three years of diagnosis, the chances of short and long-term recovery are much increased, but it is more difficult as time goes on. This is what makes this study so interesting."
She said the findings of the small study must be interpreted with caution, however.
Susan Ringwood, the chief executive of the national organisation, Beat, said: "When treatments fail to work, people with eating disorders can feel it is their fault, and that can make them very more reluctant to accept the help desperately they need.
"We are learning so much more about the brain and its role in eating disorders, and this study indicates an important new aspect that may lead to improved treatment."