Inhibitory neurons make up a substantial fraction of the neurons in the preBötzinger complex (preBötC), a site that is critical for mammalian eupneic breathing. We investigated the role of glycinergic preBötC neurons in respiratory rhythmogenesis in mice using optogenetically targeted excitation and inhibition. Channelrhodopsin-2 (ChR2) or Archaerhodopsin (Arch) were expressed in glycinergic preBötC neurons of glycine transporter 2 (Glyt2, also known as Slc6a5)-Cre mice. In ChR2-transfected mice, brief inspiratory-phase bilateral photostimulation targeting the preBötC prematurely terminated inspiration, whereas expiratory-phase photostimulation delayed the onset of the next inspiration. Prolonged photostimulation produced apneas lasting as long as the light pulse. Inspiratory-phase photoinhibition in Arch-transfected mice during inspiration increased tidal volume without altering inspiratory duration, whereas expiratory-phase photoinhibition shortened the latency until the next inspiration. During persistent apneas, prolonged photoinhibition restored rhythmic breathing. We conclude that glycinergic preBötC neurons modulate inspiratory pattern and are important for reflex apneas, but that the rhythm can persist after substantial dampening of their activity.