Many children with epilepsy do not satisfactorily respond to conventional pharmacological therapy, but to the ketogenic diet, a high-fat, low-carbohydrate diet. This diet increases the concentrations of ketone bodies and polyunsaturated fatty acids (PUFAs) in cerebrospinal fluid (CSF) and plasma. However, its anticonvulsant mechanism is not known. To investigate the mechanism by which the diet protects against seizures, we studied the effects of several PUFAs (docosahexaenoic acid, eicosapentaenoic acid, and linoleic acid), ketone bodies (beta-hydroxybuturic acid and acetoacetic acid), and CSF from patients on the ketogenic diet on the voltage-gated Shaker K channel expressed in Xenopus oocytes. We found that PUFAs at concentrations down to 21microM clearly increased the K current by shifting the conductance versus voltage curve in negative direction along the voltage axis. CSF from patients on the ketogenic diet has similar but smaller effects. In contrast, high concentrations (1-5mM) of ketone bodies did not affect the K current. Computer simulations showed that the observed shifts for clinically relevant concentrations of PUFAs, and CSF from patients could effectively impair repetitive firing. These data suggest that the ketogenic diet could prevent epileptic seizures by PUFA-induced openings of voltage-gated K channels.