Stroke is the leading cause of serious and long-term disability worldwide. Some studies have shown that motor imagery (MI) based BCI has a positive effect in poststroke rehabilitation. It could help patients promote the reorganization processes in the damaged brain regions. However, offline motor imagery and conventional online motor imagery with feedback (such as rewarding sounds and movements of an avatar) could not reflect the true intention of the patients. In this study, both virtual limbs and functional electrical stimulation (FES) were used as feedback to provide patients a closed-loop sensorimotor integration for motor rehabilitation. The FES system would activate if the user was imagining hand movement of instructed side. Ten stroke patients (7 male, aged 22-70 years, mean 49.5+-15.1) were involved in this study. All of them participated in BCI-FES rehabilitation training for 4 weeks.The average motor imagery accuracies of the ten patients in the last week were 71.3%, which has improved 3% than that in the first week. Five patients Fugl-Meyer Assessment (FMA) scores have been raised. Patient 6, who has have suffered from stroke over two years, achieved the greatest improvement after rehabilitation training (pre FMA: 20, post FMA: 35). In the aspect of brain patterns, the active patterns of the five patients gradually became centralized and shifted to sensorimotor areas (channel C3 and C4) and premotor area (channel FC3 and FC4).In this study, motor imagery based BCI and FES system were combined to provided stoke patients with a closed-loop sensorimotor integration for motor rehabilitation. Result showed evidences that the BCI-FES system is effective in restoring upper extremities motor function in stroke. In future work, more cases are needed to demonstrate its superiority over conventional therapy and explore the potential role of MI in poststroke rehabilitation.