OBJECTIVE: Recording low amplitude electroencephalography (EEG) signals in the face of large gradient artifacts generated by changing functional magnetic resonance imaging (fMRI) magnetic fields continues to be a challenge. We present a new method of removing gradient artifacts with time-varying waveforms, and evaluate it in continuous (non-interleaved) simultaneous EEG-fMRI experiments. METHODS: The current method consists of an analog filter, an EEG-fMRI timing error correction algorithm, and a temporal principal component analysis based gradient noise removal algorithm. We conducted a phantom experiment and a visual oddball experiment to evaluate the method. RESULTS: The results from the phantom experiment showed that the current method reduced the number of averaged samples required to obtain high correlation between injected and recovered signals, compared to a conventional average waveform subtraction method with adaptive noise cancelling. For the oddball experiment, the results obtained from the two methods were very similar, except that the current method resulted in a higher P300 amplitude when the number of averaged trials was small. CONCLUSIONS: The current method enabled us to obtain high quality EEGs in continuous simultaneous EEG-fMRI experiments. SIGNIFICANCE: Continuous simultaneous EEG-fMRI acquisition enables efficient use of data acquisition time and better monitoring of rare EEG events.