Regaining motor function is of high priority to patients with spinal cord injury (SCI). A variety of electronic devices that interface with the brain or spinal cord, which have applications in neural prosthetics and neurorehabilitation, are in development. Owing to our advancing understanding of activity-dependent synaptic plasticity, new technologies to monitor, decode and manipulate neural activity are being translated to patient populations, and have demonstrated clinical efficacy. Brain-machine interfaces that decode motor intentions from cortical signals are enabling patient-driven control of assistive devices such as computers and robotic prostheses, whereas electrical stimulation of the spinal cord and muscles can aid in retraining of motor circuits and improve residual capabilities in patients with SCI. Next-generation interfaces that combine recording and stimulating capabilities in so-called closed-loop devices will further extend the potential for neuroelectronic augmentation of injured motor circuits. Emerging evidence suggests that integration of closed-loop interfaces into intentional motor behaviours has therapeutic benefits that outlast the use of these devices as prostheses. In this Review, we summarize this evidence and propose that several known plasticity mechanisms, operating in a complementary manner, might underlie the therapeutic effects that are achieved by closing the loop between electronic devices and the nervous system.