We propose a method for retrospective motion correction of fMRI data in simultaneous EEG-fMRI that employs the EEG array as a sensitive motion detector. EEG motion artifacts are used to generate motion regressors describing rotational head movements with millisecond temporal resolution. These regressors are utilized for slice-specific motion correction of unprocessed fMRI data. Performance of the method is demonstrated by correction of fMRI data from five patients with major depressive disorder, who exhibited head movements by 1-3 mm during a resting EEG-fMRI run. The fMRI datasets, corrected using eight to ten EEG-based motion regressors, show significant improvements in temporal SNR (TSNR) of fMRI time series, particularly in the frontal brain regions and near the surface of the brain. The TSNR improvements are as high as 50% for large brain areas in single-subject analysis and as high as 25% when the results are averaged across the subjects. Simultaneous application of the EEG-based motion correction and physiological noise correction by means of RETROICOR leads to average TSNR enhancements as high as 35% for large brain regions. These TSNR improvements are largely preserved after the subsequent fMRI volume registration and regression of fMRI motion parameters. The proposed EEG-assisted method of retrospective fMRI motion correction (referred to as E-REMCOR) can be used to improve quality of fMRI data with severe motion artifacts and to reduce spurious correlations between the EEG and fMRI data caused by head movements. It does not require any specialized equipment beyond the standard EEG-fMRI instrumentation and can be applied retrospectively to any existing EEG-fMRI data set.