This paper describes a sliding mode controller for autonomous underwater vehicles (AUVs). The dynamic of AUV model is highly nonlinear because of many factors, such as hydrodynamic drag, damping, and lift forces, Coriolis and centripetal forces, gravity and buoyancy forces, as well as forces from thruster. To address these difficulties, a nonlinear sliding mode controller is designed to approximate the nonlinear dynamics of AUV and improve trajectory tracking. Moreover, the proposed controller can profoundly attenuate the effects of uncertainties and external disturbances in the closed-loop system. Using the Lyapunov theory the boundedness of AUV tracking errors and the stability of the proposed control system are also guaranteed. Numerical simulation studies of an AUV are included to illustrate the effectiveness of the presented approach.