Scientists performing experimental brain surgery on a man aged 50 have stumbled across a mechanism that could unlock how memory works.

The accidental breakthrough came during an experiment originally intended to suppress the obese man's appetite, using the increasingly successful technique of deep-brain stimulation. Electrodes were pushed into the man's brain and stimulated with an electric current. Instead of losing appetite, the patient instead had an intense experience of déjà vu. He recalled, in intricate detail, a scene from 30 years earlier. More tests showed his ability to learn was dramatically improved when the current was switched on and his brain stimulated.

Scientists are now applying the technique in the first trial of the treatment in patients with Alzheimer's disease. If successful, it could offer hope to sufferers from the degenerative condition, which affects 450,000 people in Britain alone, by providing a "pacemaker" for the brain.

Download the new Independent Premium app Sharing the full story, not just the headlines

Three patients have been treated and initial results are promising, according to Andres Lozano, a professor of neurosurgery at the Toronto Western Hospital, Ontario, who is leading the research.

Professor Lozano said: "This is the first time that anyone has had electrodes implanted in the brain which have been shown to improve memory. We are driving the activity of the brain by increasing its sensitivity – turning up the volume of the memory circuits. Any event that involves the memory circuits is more likely to be stored and retained."

The discovery had caught him and his team "completely by surprise", Professor Lozano said. They had been operating on the man, who weighed 190kg (30st), to treat his obesity by locating the point in his brain that controls appetite. All other attempts to curb his eating had failed and brain surgery was the last resort.

The treatment for obesity was unsuccessful. But, while the researchers were identifying potential appetite suppressant points in the hypothalamus, the part of the brain associated with hunger, the man suddenly began to say that memory was flooding back.

"He reported the experience of being in a park with friends from when he was around 20 years old and, as the intensity of stimulation increased, the details became more vivid. He recognised his girlfriend [from the time] ... The scene was in colour. People were wearing identifiable clothes and were talking, but he could not decipher what they were saying," the researchers write in Annals of Neurology, published today.

The man, who has not been identified, was also tested on his ability to learn lists of paired objects. After three weeks of continuous hypothalamic stimulation, his performance on two learning tests was significantly improved. He was also much more likely to remember a list of unrelated paired objects with the electrodes turned on than when turned off.

Speaking to The Independent yesterday, Professor Lozano said: "His performance improved dramatically. As we turned the current up, we first drove his memory circuits and improved his learning. As we increased the intensity of the current, we got spontaneous memories of discrete events. At a certain intensity, he would slash to the scene [in the park]. When the intensity was increased further, he got more detail but, when the current was turned off, it rapidly decayed."

Daily coronavirus briefing No hype, just the advice and analysis you need Enter your email address Continue Continue Please enter an email address Email address is invalid Fill out this field Email address is invalid Email already exists. Log in to update your newsletter preferences Register with your social account or click here to log in I would like to receive morning headlines Monday - Friday plus breaking news alerts by email Update newsletter preferences

The discovery surprised the scientists as the hypothalamus has not usually been identified as a seat of memory. The contacts that most readily produced the memories were located close to a structure called the fornix, an arched bundle of fibres that carries signals within the limbic system, which is involved in memory and emotions and is situated next to the hypothalamus.

Professor Lozano is a world authority on deep-brain stimulation who has undertaken 400 operations on Parkinson's disease sufferers and is developing the technique as a treatment for depression, for which he has performed 28 operations. He said the discovery of its role in stimulating memory had wide implications.

"It gives us insight into which brain structures are involved in memory. It gives us a means of intervening in the way we have already done in Parkinson's and for mood disorders such as depression, and it may have therapeutic benefit in people with memory problems," he said.

The researchers are testing the approach in six Alzheimer's patients in a Phase 1 safety study. Three have so far had electrodes surgically implanted. The electrodes are attached via a cable that runs below the skull and down the neck to a battery pack stitched under the skin of the chest. The "pacemaker" delivers a constant low-level current that stimulates the brain but cannot be perceived by the patient.

Professor Lozano said: "It is the same device as is used for Parkinson's disease. We have placed the electrodes in exactly the same area of the hypothalamus because we want to see if we can reproduce the findings in the earlier experiment. We believe the memory circuits we are stimulating are close by, physically touching the hypothalamus.

"It is a very effective treatment for the motor problems associated with Parkinson's disease and it has been used on 40,000 people. We are in the early stages of using it with Alzheimer's patients and we don't know if it will work. We want to assess if we can reach the memory circuits and drive improvement. It is a novel approach to dealing with this problem."

British researchers welcomed the discovery. Andrea Malizia, a senior lecturer in psychopharmacology at the University of Bristol who is studying deep-brain stimulation as a treatment for depression, said: "If they had said let's stick an electrode in the hypothalamus to modify Alzheimer's disease, I would have said 'Why start there?' But, if they have had a serendipitous finding, then that is as good. Serendipitous findings are how a lot of discoveries in science have been made."

Ayesha Khan, a scientific liaison officer at the Alzheimer's Disease Society, said: "This is very cutting-edge research. It is exciting, but the initial result is in one person. It will need much further investigation."

How deep-brain stimulation works

Deep -brain stimulation has been used for more than a decade to treat a range of conditions including depression, chronic pain, Parkinson's disease and other movement disorders.

It has been so successful in treating Parkinson's that 40,000 patients worldwide now have electrodes implanted in their brains driven by pacemakers stitched into their chests.

As the devices become smaller, requiring less risky surgery, and the target areas of the brain requiring stimulation are more precisely identified, demand for the treatment is expected to leap. Although it is expensive, the potential savings in care and treatment costs are immense. It does not lead to dependence on drugs and is reversible.

The electrodes are implanted under local anaesthesia while the patient is awake. Before the operation, the neurosurgeon performs an MRI scan and establishes the target location for the electrodes. He then carries out a craniotomy – lifting a section of the skull – and inserts the electrodes and leads. By stimulating the electrodes and checking the patient's response, the surgeon can check that they are positioned in the right place.

Different areas of the brain are targeted for different conditions. For Parkinson's disease, they are placed in the subthalamic nucleus; for depression, in area 25 of the cingulate cortex.

Deep-brain stimulation was developed in France and first licensed by the Food and Drug Administration in the US in 1997 as a treatment for tremor. In the UK, the surgery is performed at the National Hospital for Neurology and Neurosurgery in London, in Bristol, in Oxford and at a handful of other centres.

The name of the procedure is in some ways a misnomer as it often involves inhibiting electrical activity in an area of the brain rather than stimulating it. The technique is as much about restoring balance between competing brain areas which leads to the tremor characteristic of some types of Parkinson's disease.