Currently available optogenetic tools, including microbial light-activated ion channels and transporters, are transforming systems neuroscience by enabling precise remote control of neuronal firing, but they tell us little about the role of indigenous ion channels in controlling neuronal function. Here, we employ a chemical-genetic strategy to engineer light sensitivity into several mammalian K(+) channels that have different gating and modulation properties. These channels provide the means for photoregulating diverse electrophysiological functions. Photosensitivity is conferred on a channel by a tethered ligand photoswitch that contains a cysteine-reactive maleimide (M), a photoisomerizable azobenzene (A), and a quaternary ammonium (Q), a K(+) channel pore blocker. Using mutagenesis, we identify the optimal extracellular cysteine attachment site where MAQ conjugation results in pore blockade when the azobenzene moiety is in the trans but not cis configuration. With this strategy, we have conferred photosensitivity on channels containing Kv1.3 subunits (which control axonal action potential repolarization), Kv3.1 subunits (which contribute to rapid-firing properties of brain neurons), Kv7.2 subunits (which underlie "M-current"), and SK2 subunits (which are Ca(2+)-activated K(+) channels that contribute to synaptic responses). These light-regulated channels may be overexpressed in genetically targeted neurons or substituted for native channels with gene knockin technology to enable precise optopharmacological manipulation of channel function.