Underwater terrain-matching navigation technologies have become a popular topic for the high-precision positioning and navigation of autonomous underwater vehicles. This paper proposes an underwater terrain-matching positioning method based on a Markov random field model, which is based on real-time terrain data obtained using a multi-beam echo sounder. It focuses on the strong correlation between adjacent terrain data, which can improve terrain adaptability and matching accuracy. Playback simulation tests were conducted based on actual sea trial data, and the results showed that the proposed method has good positioning performance, which can correct the cumulative errors of inertial navigation systems. The results demonstrated the usability of the proposed method for positioning correction in underwater engineering applications.