Brain-computer interfaces(BCI) are a mechanism to record the electrical signals of the brain and translate them into commands to operate an output device like a robotic system. This article presents the development of a real-time locomotion system of a hexapod robot with bio-inspired movement dynamics inspired in the stick insect and tele-operated by cognitive activities of motor imagination. Brain signals are acquired using only four electrodes from a BCI device and sent to computer equipment for processing and classification by the iQSA method based on quaternion algebra. A structure consisting of three main stages are proposed: (1) signal acquisition, (2) data analysis and processing by the iQSA method, and (3) bio-inspired locomotion system using a Spiking Neural Network (SNN) with twelve neurons. An off-line training stage was carried out with data from 120 users to create the necessary decision rules for the iQSA method, obtaining an average performance of 97.72%. Finally, the experiment was implemented in realtime to evaluate the performance of the entire system. The recognition rate to achieve the corresponding gait pattern is greater than 90% for BCI, and the time delay is approximately from 1 to 1.5 seconds. The results show that all the subjects could generate their desired mental activities, and the robotic system could replicate the gait pattern in line with a slight delay. INDEX TERMS Bio-inspired robot, Brain-Computer Interface (BCI), electroencephalography, hexapod robot, iQSA method, motor imagery, spiking neural network, central pattern generator.