Task-related motion is a major source of noise in functional magnetic-resonance imaging (fMRI) time series. The motion effect usually persists even after perfect spatial realignment is achieved. Here, we propose a new method to remove a certain type of task-related motion effect that persists after realignment. The procedure consists of the following: the decomposition of the realigned time-series data into spatially-independent components using independent-component analysis (ICA); the automatic classification and rejection of the ICs of the task-related residual motion effects; and finally, a reconstruction without them. To classify the ICs, we utilized the associated task-related changes in signal intensity and variance. The effectiveness of the method was verified using an fMRI experiment that explicitly included head motion as a main effect. The results indicate that our ICA-based method removed the task-related motion effects more effectively than the conventional voxel-wise regression-based method.