In this paper, the optimal control problem for ship maneuvering motion is discussed. Using nonlinear mathematical models for the prediction of large maneuvering motions, the nonlinear optimal control problems with nondifferential constraints are solved by a sequential conjugate gradient-restoration algorithm. By applying these nonlinear optimization techniques, the operations of course changing maneuver for a small training ship are optimized. Compared the nonlinear optimal solutions obtained here with some linear optimal solutions such as bang-bang control or linear optimal regulator, the importance of nonlinear mathematical models for the optimization of ship maneuvering is discussed. And by using these nonlinear optimal solutions, an automatic feedback controller is proposed. The performance of the controller is checked by numerical simulation with respect to a deviation maneuver and a berthing one. The good performance of the proposed controller is confirmed by the results of these simulations.