Neurons have ion channels that are directly gated by voltage, ligands and temperature but not by light. Using structure-based design, we have developed a new chemical gate that confers light sensitivity to an ion channel. The gate includes a functional group for selective conjugation to an engineered K(+) channel, a pore blocker and a photoisomerizable azobenzene. Long-wavelength light drives the azobenzene moiety into its extended trans configuration, allowing the blocker to reach the pore. Short-wavelength light generates the shorter cis configuration, retracting the blocker and allowing conduction. Exogenous expression of these channels in rat hippocampal neurons, followed by chemical modification with the photoswitchable gate, enables different wavelengths of light to switch action potential firing on and off. These synthetic photoisomerizable azobenzene-regulated K(+) (SPARK) channels allow rapid, precise and reversible control over neuronal firing, with potential applications for dissecting neural circuits and controlling activity downstream from sites of neural damage or degeneration.