Underwater environments are extremely challenging to perform localization. Autonomous Underwater Vehicles (AUV) are usually endowed with acoustic devices such as a Mechanically Scanned Imaging Sonar (MSIS). This sensor scans the environment by emitting ultrasonic pulses and it provides echo intensity profiles of the scanned area. Our goal is to provide self-localization capabilities to an AUV endowed with a MSIS. To this end, this paper proposes a scan matching strategy to estimate the robot motion. This strategy extracts range information from the sensor data, deals with the large scan times and performs a probabilistic data association. The proposal is tested with real data obtained during a trip in a marina environment, and the results show the benefits of our proposal by comparing it to other well known approaches.