Young Xenopus tadpoles were used to test whether the pattern of discharge in specific sensory neurons can determine the motor response of a whole animal. Young Xenopus tadpoles show two main rhythmic behaviours: swimming and struggling. Touch-sensitive skin sensory neurons in the spinal cord of immobilised tadpoles were penetrated singly or in pairs using microelectrodes to allow precise control of their firing patterns. A single impulse in one Rohon-Beard neuron (= light touch) could sometimes trigger "fictive" swimming. Two to six impulses at 30-50 Hz (= a light stroke) reliably triggered fictive swimming. Neither stimulus evoked fictive struggling. Twenty-five or more impulses at 30-50 Hz (= pressure) could evoke a pattern of rhythmic bursts, distinct from swimming and suitable to drive slower, stronger movements. This pattern showed some or all the characteristics of "fictive" struggling. These results demonstrate clearly that sensory neurons can determine the pattern of motor output simply by their pattern of discharge. This provides a simple form of behavioural selection according to stimulus.