Neural mechanisms underlying selection of motor responses are largely unknown in vertebrates. This study shows that in immobilized Xenopus embryos, brief mechanical or electrical stimulation of the trunk skin can trigger sustained fictive swimming, whereas sustained pressure or repetitive electrical stimulation can evoke fictive struggling. These two rhythmic motor patterns are distinct: alternating single motor root spikes propagate from head to tail during swimming; alternating motor root bursts propagate from tail to head during struggling. As both motor patterns can be evoked in embryos with the CNS transected caudal to the cranial roots, the sensory pathway responsible must have direct access to the spinal cord. Rohon--Beard sensory neurons provide the only such pathway known. They respond appropriately to brief stimuli applied to the trunk skin, and also to repetitive electrical stimuli and sustained pressure. The results suggest that Rohon--Beard sensory neurons can both trigger sustained swimming and `gate in' struggling motor patterns, and thus effect behavioural selection according to their pattern of activity.