The neural control of motor behaviour arises from the joint activity of large neuron populations. Unknown is what underlying dynamical system generates this joint activity. Here we show that the network-wide activity driving locomotion of the sea-slug Aplysia is a low-dimensional spiral attractor. We imaged large populations at single-spike resolution from the Aplysia's pedal ganglion during fictive locomotion. Evoking locomotion rapidly moved the population activity from irregular spontaneous activity into a low-dimensional, periodic, decaying, orbit. This orbit was a true attractor: the activity returned to the same orbit after transient perturbation; and repeatedly evoking locomotion caused the activity to converge on the same low-dimensional orbit. To show this attractor was the locomotion program, we accurately decoded simultaneous recordings of neck motorneuron activity directly from the low-dimensional orbit. Our results provide direct evidence that neural circuits are periodic attractors. Consequently, they support the long-held hypothesis that population activity is an emergent property of a simpler underlying system.