Coordinated development of brain stem and spinal target neurons is pivotal for the emergence of a precisely functioning locomotor system. Signals that match the development of these far-apart regions of the central nervous system may be redeployed during spinal cord regeneration. Here we show that descending dopaminergic projections from the brain promote motor neuron generation at the expense of V2 interneurons in the developing zebrafish spinal cord by activating the D4a receptor, which acts on the hedgehog pathway. Inhibiting this essential signal during early neurogenesis leads to a long-lasting reduction of motor neuron numbers and impaired motor responses of free-swimming larvae. Importantly, during successful spinal cord regeneration in adult zebrafish, endogenous dopamine promotes generation of spinal motor neurons, and dopamine agonists augment this process. Hence, we describe a supraspinal control mechanism for the development and regeneration of specific spinal cell types that uses dopamine as a signal.