A system and method for controlling neural and muscular function is disclosed in which opsins are introduced into a neural circuit such that the control of optical signals transmitted to the opsins results in the control of neural and muscular functions. Specifically disclosed is the control of the bladder, bowel, and sexual functions of a human.