All procedures were approved by the UC Irvine Animal Care and Use Committee. Surgical procedures were performed stereotaxically under isofluorane anaesthesia and local nerve block induced by 0.5% bupivacaine. Kainic acid (50–100 nl, 20 mM in saline, Tocris Bioscience) was injected into the left dorsal hippocampus (2.0 mm posterior, 1.25 mm left, and 1.6 mm ventral to bregma) of mice on or after postnatal day 46. After recovery, animals were returned to the vivarium for at least 2 weeks to allow for the emergence of spontaneous recurrent seizures. Bipolar depth electrodes (PlasticsOne) and optical fibres (0.37NA, Low OH, 200 μm diameter, ThorLabs) terminated in 1.25 mm ceramic ferrules (Kientec Systems, Inc.) were implanted ipsilaterally (posterior 2.5 mm, left 1.75 mm, ventral 1.25 mm with respect to bregma) and in some cases, also contralaterally at the same posteroventral position into the hippocampus, targeting the dorsal stratum oriens of the CA1 such that emitted light would illuminate the hippocampal formation. Optical fibres and electrodes were fixed to the skull using screws (McMaster-Carr) and dental cement (Teets Cold Curing) and the animals were allowed to recover for several days before beginning 24-h video and EEG monitoring for seizures and subsequent closed-loop seizure detection and light delivery. On average, animals were implanted 15±2.3 weeks after KA injection and the effect of light on seizures was examined 15.9±1.4 weeks after KA injection (range: 2.4–24.6 weeks). There was no correlation between seizure duration reduction and time since KA for either Cam-HR or PV-ChR2 mice (P=0.39 and P=0.83, respectively, Spearman test; see also Supplementary Fig. S3).