In this paper, a contour error control strategy based on spatial iterative learning control (sILC) is developed for repetitive processing of five-axis computer numerical control (CNC) machine tools. A curve approximation method with an adaptive moving window is developed to achieve accurate tool position and orientation contour error estimation, and a five-axis contour error control strategy based on sILC is proposed. The compensation method is derived using an sILC algorithm to modify the geometric reference path instead of modifying the controller. The experimental results show that the proposed control strategy reduces contour errors of five-axis CNC machine tools, and it outperforms the traditional tracking error control.