The sea roach is an isopod with 14 legs; owing to its many degrees of freedom and coordination thereof, it can walk rapidly on rough terrain. Although there likely exists a remarkable decentralized control mechanism that facilitates fast and adaptive locomotion of sea roaches, it still remains elusive. To address this issue, we performed behavioural experiments and revealed that sea roaches often change their gait patterns depending on the locomotion speed. We suggest that the bending of the body trunk in the pitch direction is essential for the gait transitions, and we propose a decentralized control mechanism for body-limb coordination. We demonstrate this with a sea-roach-like robot whose gait transition is achieved by the proposed mechanism. This mechanism has some points in common with control mechanisms proposed for other legged animals. Thus, our findings will help unveil the common principle of legged locomotion and aid the design of multi-legged robots that move like animals.