Sensory feedback as well as the coupling signals within the CNS are essential for leeches to produce intersegmental phase relationships in body movements appropriate for swimming behavior. To study the interactions between the central pattern generator (CPG) and peripheral feedback in controlling intersegmental coordination, we have constructed a computational model for the leech swimming system with physiologically realistic parameters. First, the leech swimming CPG is simulated by a chain of phase oscillators coupled by three channels of coordinating signals. The activity phase, the projection direction, and the phase response curve (PRC) of each channel are based on the identified intersegmental interneuron network. Output of this largely constrained model produces stable coordination in the simulated CPG with average phase lags of 8-10 degrees/segment in the period range from 0.5 to 1.5 s, similar to those observed in isolated nerve cords. The model also replicates the experimental finding that shorter chains of leech nerve cords have larger phase lags per segment. Sensory inputs, represented by stretch receptors, were subsequently incorporated into the CPG model. Each stretch receptor with its associated PRC, which was defined to mimic the experimental results of phase-dependent phase shifts of the central oscillator by the ventral stretch receptor, can alter the phase of the local central oscillator. Finally, mechanical interactions between the muscles from neighboring segments were simulated by PRCs linking adjacent stretch receptors. This model shows that interactions between neighboring muscles could globally increase the phase lags to the larger value required for the one-wavelength body form observed in freely swimming leeches. The full model also replicates the experimental observation that leeches with severed nerve cords have larger intersegmental phase lags than intact animals. The similarities between physiological and simulation results demonstrate that we have established a realistic model for the central and peripheral control of intersegmental coordination of leech swimming.