The nudibranch mollusc Melibe leonina swims by bending from side to side. We have identified a network of neurons that appears to constitute the central pattern generator (CPG) for this locomotor behavior, one of only a few such networks to be described in cellular detail. The network consists of two pairs of interneurons, termed 'swim interneuron 1' (sint1) and 'swim interneuron 2' (sint2), arranged around a plane of bilateral symmetry. Interneurons on one side of the brain, which includes the paired cerebral, pleural and pedal ganglia, coordinate bending movements toward the same side and communicate via non-rectifying electrical synapses. Interneurons on opposite sides of the brain coordinate antagonistic movements and communicate over mutually inhibitory synaptic pathways. Several criteria were used to identify members of the swim CPG, the most important being the ability to shift the phase of swimming behavior in a quantitative fashion by briefly altering the firing pattern of an individual neuron. Strong depolarization of any of the interneurons produces an ipsilateral swimming movement during which the several components of the motor act occur in sequence. Strong hyperpolarization causes swimming to stop and leaves the animal contracted to the opposite side for the duration of the hyperpolarization. The four swim interneurons make appropriate synaptic connections with motoneurons, exciting synergists and inhibiting antagonists. Finally, these are the only neurons that were found to have this set of properties in spite of concerted efforts to sample widely in the Melibe CNS. This led us to conclude that these four cells constitute the CPG for swimming. While sint1 and sint2 work together during swimming, they play different roles in the generation of other behaviors. Sint1 is normally silent when the animal is crawling on a surface but it depolarizes and begins to fire in strong bursts once the foot is dislodged and the animal begins to swim. Sint2 also fires in bursts during swimming, but it is not silent in non-swimming animals. Instead activity in sint2 is correlated with turning movements as the animal crawls on a surface. This suggests that the Melibe motor system is organized in a hierarchy and that the alternating movements characteristic of swimming emerge when activity in sint1 and sint2 is bound together.