This paper concerns the problem of correcting spin-history artefacts in fMRI data. We focus on the influence of through-plane motion on the history of magnetization. A change in object position will disrupt the tissue's steady-state magnetization. The disruption will propagate to the next few acquired volumes until a new steady state is reached. In this paper we present a simulation of spin-history effects, experimental data, and an automatic two-step algorithm for detecting and correcting spin-history artefacts. The algorithm determines the steady-state distribution of all voxels in a given slice and indicates which voxels need a spin-history correction. The spin-history correction is meant to be applied before standard realignment procedures. To obtain experimental data a special phantom and an MRI compatible motion system were designed. The effect of motion on spin-history is presented for data obtained using this phantom inside a 1.5-T MRI scanner. We show that the presented algorithm is capable of detecting the occurrence of a displacement, and it determines which voxels need a spin-history correction. The results of the phantom study show good agreement with the simulations.