As the electronic magnetic compass is extremely easy to be influenced by the surrounding magnetic field and hence generates data with large deviation, the method of compass fault detection for AUV is studied in this paper. Firstly, the full state nonlinear model of AUV is obtained by correlating kinematic and dynamic equations. Secondly, the measurement deviation of the compass is analyzed and the model of the deviation is established. Based on this, a fault detection method based on Bayesian estimation is proposed and the iterative formula of the method in the discrete form is presented. Finally, simulations and field experiments are designed and carried out according to the parameters of the compass and the maneuver capability of the AUV and the results verify the correctness and effectiveness of this method.