Brain-computer interfaces (BCI) are used in stroke rehabilitation to translate brain signals into intended movements of the paralyzed limb. However, the efficacy and mechanisms of BCI-based therapies remain unclear. Here we show that BCI coupled to functional electrical stimulation (FES) elicits significant, clinically relevant, and lasting motor recovery in chronic stroke survivors more effectively than sham FES. Such recovery is associated to quantitative signatures of functional neuroplasticity. BCI patients exhibit a significant functional recovery after the intervention, which remains 6-12 months after the end of therapy. Electroencephalography analysis pinpoints significant differences in favor of the BCI group, mainly consisting in an increase in functional connectivity between motor areas in the affected hemisphere. This increase is significantly correlated with functional improvement. Results illustrate how a BCI-FES therapy can drive significant functional recovery and purposeful plasticity thanks to contingent activation of body natural efferent and afferent pathways.