In this paper, an optimal lateral control method for autonomous vehicle based on multi-stage handling inverse dynamics is proposed. By applying this method, the vehicle can be controlled to complete the corresponding driving task without tracking a certain ideal state variable trajectory. Firstly, a separate-stage handling inverse dynamics problem is described; and by setting the connections between each stage, a multi-stage handling inverse dynamics model is developed; then we convert the inverse dynamics problem into an optimal control problem (OCP). Secondly, an improved hp-adaptive Radau pseudospectral method ( hp-RPM) is applied to discrete the continuous OCP; and then the sequential quadratic programming is used to solve the problem. In addition, the results of contrast verification show that, when solving non-smooth problem, the improved hp-RPM has higher computational efficiency than hp-RPM. Finally, simulations under three typical cases and bench tests illustrate the effectiveness of the proposed method.