A device and method for gait training, such as for rehabilitation of a person after a stroke is provided. In some embodiments, the device comprises a stimulator, preferably electric stimulator, for provoking a spinal cord withdrawal reflex in the person by stimulation on the person's foot in response to a control signal. Hereby, the person's leg will move and initiate a gait swing. A sensor is placed to sense movement of the leg and provide a feedback signal accordingly. A processor unit with a processor runs a control algorithm which calculates the control signal in response to the feedback signal. Thus, the method is based on a closed-loop design, and the control signal is preferably calculated for each walking step, and it is preferably based on the feedback signal obtained from the preceding walking step. Hereby reflex habituation can be accounted for. Preferably, the stimulator has a plurality of stimulator channels with electrodes placed on different sites distributed on the sole of the foot and on the heel. The feedback signal may be based on accelerometer(s), and / or gyroscope(s), and / or goinometer(s) positioned on the leg and / or foot, e.g. partly or fully integrated in an in-sole for a shoe etc.