Locomotor systems are often controlled by specialized cephalic neurons and undergo modulation by sensory inputs. In many species, dedicated brain regions initiate and maintain behavior and set the duration and frequency of the locomotor episode. In the leech, removing the entire head brain enhances swimming, but the individual roles of its components, the supra- and subesophageal ganglia, in the control of locomotion are unknown. Here we describe the influence of these two structures and that of the tail brain on rhythmic swimming in isolated nerve cord preparations and in nearly-intact leeches suspended in an aqueous, “swim-enhancing” environment. We found that, in isolated preparations, swim episode duration and swim burst frequency are greatly increased when the supraesophageal ganglion is removed, but the subesophageal ganglion is intact. The prolonged swim durations observed with the anterior-most ganglion removed were abolished by removal of the tail ganglion. Experiments on the nearly intact leeches show that, in these preparations, the subesophageal ganglion acts to decrease cycle period but, unexpectedly, also decreases swim duration. These results suggest that the supraesophageal ganglion is the primary structure that constrains leech swimming; however, the control of swim duration in the leech is complex, especially in the intact animal.