An unknown nonlinear disturbance seriously affects the trajectory tracking of autonomous underwater vehicles (AUVs). Thus, it is critical to eliminate the influence of such disturbances on AUVs. To address this problem, this paper proposes a double-loop proportional–integral–differential (PID) neural network sliding mode control (DLNNSMC). First, a double-loop PID sliding mode surface is proposed, which has a faster convergence speed than other PID sliding mode surfaces. Second, a nonlinear high-order observer and a neural network are combined to observe and compensate for the nonlinear disturbance of the AUV system. Then, the bounded stability of an AUV closed-loop system is analyzed and demonstrated using the Lyapunov method, and the time-domain method is used to verify that the velocity- and position-tracking errors of AUVs converge to zero exponentially. Finally, the radial basis function (RBF) neural network PID sliding mode control (RBFPIDSMC) and the RBF neural network PID sliding mode control (RBFPDSMC) are compared with this method in two trajectory tracking control simulation experiments. In the first experiment, the average Euclidean distance of the position-tracking error for this method was reduced by approximately 73.6% and 75.3%, respectively, compared to those for RBFPDSMC and RBFPIDSMC. In the second experiment, the average Euclidean distance of the position tracking error for this method was reduced by approximately 86.8% and 88.8%, respectively. The two experiments showed that the proposed control method has a strong anti-jamming ability and tracking effect. The simulation results obtained in the Gazebo environment validated the superiority of this method.