Animals move over a range of speeds by using rhythmic networks of neurons located in the spinal cord. Here we use electrophysiology and in vivo imaging in larval zebrafish (Danio rerio) to reveal a systematic relationship between the location of a spinal neuron and the minimal swimming frequency at which the neuron is active. Ventral motor neurons and excitatory interneurons are rhythmically active at the lowest swimming frequencies, with increasingly more dorsal excitatory neurons engaged as swimming frequency rises. Inhibitory interneurons follow the opposite pattern. These inverted patterns of recruitment are independent of cell soma size among interneurons, but may be partly explained by concomitant dorso-ventral gradients in input resistance. Laser ablations of ventral, but not dorsal, excitatory interneurons perturb slow movements, supporting a behavioural role for the topography. Our results reveal an unexpected pattern of organization within zebrafish spinal cord that underlies the production of movements of varying speeds.