They believe their approach could help people who cannot control their seizures with drugs.
The study, published in the journal Science Translation Medicine, used a virus to insert the new genes into a small number of neurons.
About 50 million people have epilepsy worldwide.
However, drugs do not work for up to 30% of them. The alternatives include surgery to remove the part of the brain that triggers a fit or to use electrical stimulation.
The brain is alive with electrical communication with individual neurons primed to fire off new messages. However, if a group of neurons become too excited they can throw the whole system into chaos leading to an epileptic seizure.
Researchers at University College London have developed two ways of manipulating the behaviour of individual cells inside the brain in order to prevent those seizures.
Both use viruses injected into the brain to add tiny sections of DNA to the genetic code of just a few thousand neurons.
One method boosts the brain cells’ natural levels of inhibition in order to calm them down.
One of the researchers, Dr Robert Wyke, told the BBC: “It’s the first time a gene therapy has been used to completely stop these seizures.
“Obviously we’re very hopeful for this. Drugs haven’t done anything for epilepsy in the last 20 to 30 years, just less side effects.
“There’s a real need for a new therapy, we’ve very excited about this.”
The other technique harnessed a gene from algae which can be controlled by light. After the therapy the function of the neurons did not change until a light was shined on them with an implanted laser.
The light prevented the neurons from firing, preventing a seizure. The researchers think this method could work in a similar way to an implanted defibrillator, which is used to control an irregular heartbeat.
Much more testing of the epilepsy gene therapies would be needed before it could be used in patients.
If further animal tests are successful the first patients involved in any trial are likely to be those who are suitable and prepared for brain surgery. If there were problems or if the treatment did not work, the offending region of the brain could still be removed.
Philip Lee, the chief executive of Epilepsy Action, said: “Gene therapy research is an important development in our understanding of epilepsy. It is very encouraging that progress is being made in this arena to help people with epilepsy.
“Currently, there is no treatment to cure epilepsy other than surgery, which is only effective for small numbers and around 30% of people with epilepsy do not respond to traditional drug therapies.
“It is therefore vital that there are as many treatment options available as possible to help people with epilepsy achieve seizure control.
“Although it is too early to say if this research will directly benefit people with epilepsy in the future, we hope it helps us to move closer to more effective treatments.”
Analysis: Gene therapy
This treatment is a form of gene therapy, a field which is often criticised for failing to deliver on decades of promise.
Europe approved its first gene therapy only in November 2012.
Early trials had problems with patients developing leukaemia and in one a teenager died.
One of the issues was where the new piece of DNA was inserted into the genetic code as it could disrupt other genes. There were also concerns about the safety of the virus.
The lentivirus used in this study should insert genes into a set, safe, piece of the genome.
Researcher Dr Robert Wyke said it looked like “it’s going to be a safe thing”.
Source: By James GallagherHealth and science reporter, BBC News