This paper proposes a framework to perform Simultaneous Localization and Mapping (SLAM) using the scans gathered by a Mechanically Scanned Imaging Sonar (MSIS). To this end, the acoustic profiles provided by the MSIS are processed to obtain range data. Also, dead reckoning is used to compensate the robot motion during the sonar mechanical scanning and build range scans. When a new scan is constructed, its estimated position with respect to the previously gathered one is used to augment the SLAM state vector. Also, each new scan is matched against the previously detected ones by means of scan matching techniques. As the state vector contains relative positions between consecutively gathered scans, the measurement update explicitly takes into account the robot trajectory involved in each loop closure.