A trajectory control algorithm, termed "Target Path Iteration (TPI) algorithm" is proposed for maneuvering of surface ships and its performance studied. A mathematical model for nonlinear maneuvering of cargo ships has been used in conjunction with the proposed algorithm. The TPI method works with one error measure, namely, the average mean square error, which is minimized to obtain the desired rudder angle. The proposed control scheme has been verified for a variety of straight line and curved trajectories and its performance has been found excellent. © 2014 Elsevier Ltd.