Despite rigid-body realignment to compensate for head motion during an echo-planar imaging time-series scan, nonrigid image deformations remain due to changes in the effective shim within the brain as the head moves through the B0 field. The current work presents a combined prospective/retrospective solution to reduce both rigid and nonrigid components of this motion-related image misalignment. Prospective rigid-body correction, where the scan-plane orientation is dynamically updated to track with the subject's head, is performed using an active marker setup. Retrospective distortion correction is then applied to unwarp the remaining nonrigid image deformations caused by motion-induced field changes. Distortion correction relative to a reference time-frame does not require any additional field mapping scans or models, but rather uses the phase information from the echo-planar imaging time-series itself. This combined method is applied to compensate echo-planar imaging scans of volunteers performing in-plane and through-plane head motions, resulting in increased image stability beyond what either prospective or retrospective rigid-body correction alone can achieve. The combined method is also assessed in a blood oxygen level dependent functional MRI task, resulting in improved Z-score statistics. Magn Reson Med, 2013. © 2012 Wiley Periodicals, Inc.