We show that an ongoing locomotor pattern can be modulated by application of discrete electrical stimuli to the spinal cord at specific phases of the locomotor cycle. Data is presented from a series of experiments on in vitro lamprey spinal cords, which were used as an animal model for severe spinal cord injury. For any given stimulus, the effects on frequency, length, and symmetry of locomotor output show a strong dependence on the phase at which stimulation is applied. The most significant changes are seen when stimulation occurs during motor bursting: stimuli applied to the ipsilateral spinal hemicord increase the burst length, while stimuli applied to the contralateral spinal hemicord decrease the burst length. Simulations using experimentally-measured phase-dependent responses indicate that by monitoring the state of the neural system, it should be possible to apply stimuli at the appropriate times to modulate the lamprey "gait" on a cycle-by-cycle basis. Eventually, this approach could lead to development of a neuroprosthetic device for restoring locomotion after paralysis.