Patients with severe obsessive-compulsive disorder have shown remarkable improvements after undergoing an experimental procedure in which electrodes are placed inside the brain.

The first UK trial of deep brain stimulation for OCD involved six people who were extremely severely affected by the condition. The patients each had four electrodes surgically inserted through the skull into the brain. These are used to electrically stimulate brain circuits with the aim of bringing the illness under control.

One of the patients, a woman who is now in her 40s, described how her life was entirely dominated by her illness for a decade before taking part in the trial. Her OCD rituals meant it took up to 14 hours to go to the toilet, several hours to get out of bed and she lived in a psychiatric unit. She was terrified of poisons and contamination and would sob in frustration for hours each day because her situation felt so unbearable. “It was paralysing,” said the woman, who wants to remain anonymous.

She said her life had been transformed beyond recognition by the procedure. Six years after having the electrodes permanently placed inside her brain, she lives independently in a flat, is in a relationship and does regular voluntary work.

“For me it’s just been a miracle,” she said. “Every day when I wake up, I can’t believe my luck, I can’t get used to it.”

People with OCD typically struggle with unwanted, intrusive thoughts and repetitive rituals. The condition, which is thought to affect about 1.2% of the population, can normally be controlled with medication and behavioural therapies. However, in the most severe cases, OCD can be overwhelming, leaving people housebound, distressed and unable to carry out day-to-day tasks.

The participants in the trial, which took place several years ago, had all been affected by OCD for at least 20 years and had not responded to conventional treatments such as medications and cognitive behavioural therapy.

“It could seem to be an extreme treatment but it’s for an extremely ill group of people,” said Eileen Joyce, a professor of neuropsychiatry at University College London, who led the study.

Previous trials of deep brain stimulation for intractable OCD had given somewhat conflicting results, leaving doctors uncertain about the benefits. One issue was that different teams had targeted different brain regions, meaning it was unclear whether some of the trials had focused on the wrong brain area, or whether the treatment was only effective in certain subsets of patients.

The latest trial aimed to resolve this by alternately stimulating two different brain regions, both known to show abnormal activity in OCD, within the same six patients.

The procedure involved placing the four probes into the two brain regions (which are mirrored on each side of the brain) in surgery that lasted 10 hours. Tiny wires running under the skin from the probes to a rechargeable battery on the chest were also put in place. After recovery from the surgery, the electrodes were switched, boosting the electrical activity in the brain circuits that they tapped into. The stimulation is very mild, meaning the patients do not feel anything, physically, when it is switched on.

The stimulation was found to produce significant improvements in all of the patients and five of them opted to continue with the stimulation after the trial ended.

The patients appeared to get different benefits depending on which brain region was targeted. One brain region, the amSTN, helped improve “cognitive flexibility”, an ability to shift thoughts from one concept to another that is seriously compromised in OCD. The other brain region, the VC/VS, helped improve mood.

According to Joyce, this suggests that different brain circuits are involved in generating the distinct symptoms associated with OCD. The scientists observed that the patients’ symptoms returned in cases where the battery needed recharging, appearing to rule out the possibility that the changes were due to a powerful placebo effect.

The experiences of the patients differed. The woman who spoke to the Guardian responded dramatically “within about 10 minutes”.

She recalled texting everyone in her phone to tell them and going shopping in London with her mother for the first time in years. “I just started doing things,” she said. “It was some physical thing that happened in my brain to put me in a good mood. I’ve been like that ever since.”

Others in the trial, reported in the journal Biological Psychiatry, responded more slowly and to a lesser degree. “Overall, they were able to do much more,” said Joyce. “They do have residual symptoms and they’re not able to go back to work, but their quality of life is significantly better.”

Joyce hopes the treatment could in future become available to other patients on the NHS, if the benefits are confirmed in a larger clinical trial. However, she added, it would only ever be appropriate for patients with the most severe forms of OCD that had not responded to other treatments.