Brain-computer interfaces (BCIs), as any other interaction modality based on physiological signals and body channels (e.g., muscular activity, speech and gestures), are prone to errors in the recognition of subject's intent. An elegant approach to improve the accuracy of BCIs consists of a verification procedure directly based on the presence of error-related potentials (ErrP) in the EEG recorded right after the occurrence of an error. Two healthy volunteer subjects with little prior BCI experience participated in a real-time human-robot interaction experiment where they were asked to mentally move a cursor towards a target that can be reached within a few steps using motor imagery. These experiments confirm the previously reported presence of a new kind of ErrP. These Interaction ErrP exhibit a first sharp negative peak followed by a positive peak and a second broader negative peak (~270, ~330 and ~430 ms after the feedback, respectively). The objective of the present study was to simultaneously detect erroneous responses of the interface and classifying motor imagery at the level of single trials in a real-time system. We have achieved online an average recognition rate of correct and erroneous single trials of 84.7% and 78.8%, respectively. The off-line post-analysis showed that the BCI error rate without the integration of ErrP detection is around 30% for both subjects. However, when integrating ErrP detection, the average online error rate drops to 7%, multiplying the bit rate by more than 3. These results show that it's possible to simultaneously extract in real-time useful information for mental control to operate a brain-actuated device as well as correlates of cognitive states such as error-related potentials to improve the quality of the brain-computer interaction.