Adding "calm down" genes to hyperactive brain cells has completely cured rats of epilepsy for the first time, say UK researchers.
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.
After a fortnight the number of seizures dropped dramatically and the mice were "effectively cured" within a month.
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're 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."