A neural network-based iterative optimal controller for nonlinear systems is presented. The controller is designed based on the neural networks using iterative optimal methods. In order to reduce the errors of identification and iterative learning, a compensation controller is added in the control system. The simulation results show the efficiency of the proposed method.