A new principle of sensorimotor control of legged locomotion in an unpredictable environment is proposed on the basis of neurophysiological knowledge and a theory of nonlinear dynamics. Stable and flexible locomotion is realized as a global limit cycle generated by a global entrainment between the rhythmic activities of a nervous system composed of coupled neural oscillators and the rhythmic movements of a musculo-skeletal system including interaction with its environment. Coordinated movements are generated not by slaving to an explicit representation of the precise trajectories of the movement of each part but by dynamic interactions among the nervous system, the musculo-skeletal system and the environment. The performance of a bipedal model based on the above principle was investigated by computer simulation. Walking movements stable to mechanical perturbations and to environmental changes were obtained. Moreover, the model generated not only the walking movement but also the running movement by changing a single parameter nonspecific to the movement. The transitions between the gait patterns occurred with hysteresis.