Functional electrical stimulation (FES) enables restoration of movement in individuals with spinal cord injury. FES-based devices use electric current pulses to stimulate and excite the intact peripheral nerves. They produce muscle contractions, generate joint torques, and thus, joint movements. Since the underlying neuromuscular-skeletal system is highly nonlinear and time-varying, feedback control is necessary for accurate control of the generated movement. However, classical feedback/closed-loop control algorithms have so far failed to provide satisfactory performance and were not able to guarantee stability of the closed-loop system. Because of this, only open-loop controlled FES devices are in clinical use in spite of their limitations. The purpose of the reported research was to design a novel closed-loop FES controller that achieves good tracking performance and guarantees closed-loop stability. Such a controller was designed based on a mathematical neuromuscular-skeletal model and is founded on a sliding mode control theory. The controller was used to control shank movement and was tested in computer simulations as well as in actual experiments on healthy and spinal cord injured subjects. It demonstrated good robustness, stability, and tracking performance properties.