In this paper, a nonlinear midcourse missile controller with Thrust Vector Control (TVC) inputs for the interception of a theater ballistic missile is presented. First an optimal midcourse guidance law is designed to minimize die control effort and the distance between the missile and the target Then, a quaternion-based sliding-mode attitude controller is proposed to track the attitude command and to cope with the effects from variations of missile's inertia, aerodynamic force, and wind gusts. The exponential stability of the overall system is analyzed thoroughly via Lyapunov stability theory. Extensive simulations are conducted to validate the effectiveness of the proposed guidance law and the associated TVC.