Seizures are caused by bursts of electrical activity in the brain
A special high-fat diet helps to control fits in children with epilepsy, a UK trial suggests.
The number of seizures fell by a third in children on the "ketogenic" diet, where previously they had suffered fits every day despite medication.
The diet alters the body's metabolism by mimicking the effects of starvation, the researchers reported in the Lancet Neurology.
The researchers called for the diet to be more widely available on the NHS.
It is the first trial comparing the diet with routine care, even though it has been around since the 1920s.
Children are given a tailored diet very high in fat, low in carbohydrate and with controlled amounts of protein.
It is not exactly clear how it works but it seems that ketones, produced from the breakdown of fat, help to alleviate seizures.
A total of 145 children aged between two and 16 who had failed to respond to treatment with at least two anti-epileptic drugs took part in the study.
Half started the diet immediately and half waited for three months.
The number of seizures in the children on the diet fell to two-thirds of what they had been, but remained unchanged in those who had not yet started the diet, the researchers reported.
Five children in the diet group saw a seizure reduction of more than 90%.
However, there were some side-effects including constipation, vomiting, lack of energy and hunger.
Professor Helen Cross, study leader and consultant in neurology at Great Ormond Street Hospital in London, said the diet had been around for a long time but had fallen out of favour because it was thought to be too difficult to stick to.
"The parents say the first two weeks are quite difficult, but then it becomes much easier because you can make foods in bulk and it especially helps if you can see the benefits from it," she said.
"We have to be sensible about it, in this study we had children who had complex epilepsy.
"If your epilepsy is easily controlled on one medication then I wouldn't advocate the diet, but if at least two drugs have failed then it should be considered."
She said national guidelines recommend the diet as a treatment option, but a shortage of dieticians meant it was often unavailable.
A spokesperson for Epilepsy Action said: "The results of this trial add valuable information to what is already known about the diet, presenting evidence that it works for some children with drug-resistant epilepsy.
"In addition to this, however, we also recognise that the ketogenic diet is not without its side-effects, and that the risks and benefits should be considered before prescribing, as with drug treatment."
She said the results would hopefully encourage wider inclusion of the diet in the management of children with drug-resistant epilepsy.