A basic question in the field of motor control is how different actions are represented by activity in spinal projection neurons. We used a new behavioral assay to identify visual stimuli that specifically drive basic motor patterns in zebrafish. These stimuli evoked consistent patterns of neural activity in the neurons projecting to the spinal cord, which we could map throughout the entire population using in vivo two-photon calcium imaging. We found that stimuli that drive distinct behaviors activated distinct subsets of projection neurons, consisting, in some cases, of just a few cells. This stands in contrast to the distributed activation seen for more complex behaviors. Furthermore, targeted cell by cell ablations of the neurons associated with evoked turns abolished the corresponding behavioral response. This description of the functional organization of the zebrafish motor system provides a framework for identifying the complete circuit underlying a vertebrate behavior.In a behaving animal, the brain communicates its intentions to muscles via the pattern of activity in descending projection neurons 1 . In vertebrates, these cells respond to the detection and processing of sensory stimuli and transmit their motor command to the local networks of the spinal cord, which in turn initiate and coordinate muscle contraction 2 . A fundamental question in neuroscience is how the commands that initiate behaviors are encoded in the activation of these projection neurons 3-5 .The spinal projection system of fish provides an excellent model for studying this code 6 . A diverse range of swimming behaviors can be seen in 6-d-old zebrafish 7-9 that are mediated by a descending projection to the spinal cord consisting of fewer than 300 neurons 10,11 . These neurons are easily labeled with fluorescent indicators 12 , optically accessible with modern imaging techniques and arranged in a stereotyped pattern such that the same cells or groups of cells can easily be identified from one fish to the next 13 . These neurons are morphologically diverse, with distinct dendritic fields and axonal projection patterns 13,14 , suggesting that they serve different behavioral functions. Nevertheless, determining how differing patterns of activity in these spinal projection neurons produce different motor outputs has proved to be difficult. 23,24 , the actual command is encoded in distributed activity throughout the population of control neurons 2 .The swimming behaviors of zebrafish, including the complex sequence of turns and swims that make up the escape response, can be broken down into basic kinematic elements 8 . It is possible that the motor commands for these basic behaviors originate from distinct populations of neurons, which when combined would appear as a `distributed command'. We found that whole-field visual motion, with the direction dynamically locked to the fish's body axis, is able to selectively evoke some of these basic swim patterns. Calcium imaging of stimulus-evoked responses in the complete population of n...