This study is concerned with the integrated system of a robot and a machine tool. The major task of robot is loading the workpiece to the machine tool for contour cutting. An iterative learning control (ILC) algorithm is proposed to improve the accuracy of the finished product. The proposed ILC is to modify the input command of the next machining cycle for both robot and machine tool to iteratively enhance the output accuracy of the robot and machine tool. The modified command is computed based on the current tracking/contour error. For the ILC of the robot, tracking error is considered as the control objective to reduce the tracking error of motion path, in particular, the error at the endpoint. Meanwhile, for the ILC of the machine tool, contour error is considered as the control objective to improve the contouring accuracy, which determines the quality of machining. In view of the complicated contour error model, the equivalent contour error instead of the actual contour error is taken as the control objective in this study. One challenge for the integrated system is that there exists an initial state error for the machine tool dynamics, violating the basic assumption of ILC. It will be shown in this study that the effects of initial state error can be significantly reduced by the ILC of the robot. The proposed ILC algorithm is verified experimentally on an integrated system of commercial robot and machine tool. The experimental results show that the proposed ILC can achieve more than 90% of reduction on both the RMS tracking error of the robot and the RMS contour error of the machine tool within six learning iterations. The results clearly validate the effectiveness of the proposed ILC for the integrated system.