Inversion of Rayleigh wave dispersion curves is challenging due to its nonlinearity and multimodality. In this paper, a Simulated Annealing (SA) algorithm is applied to the nonlinear inversion of fundamental-mode Rayleigh wave group dispersion curves for shear and compressional wave velocities. In our approach, we invert thickness, velocities and densities and their vertical gradients of four layers, sediments, upper-crust, lower-crust and lithospheric mantle.At first, to determine the efficiency and stability of the method, noise-free and noisy synthetic data sets are inverted. Results from the synthetic data demonstrate that the SA applied to the nonlinear inversion of surface wave data is interesting not only in terms of accuracy but also in terms of the convergence speed. In fact, the SA method is suitable for large-scale optimization problems, especially for those in which a desired global minimum is hidden among many local minima. In a second step, real data in SE Iran are inverted to examine the usage and robustness of the proposed approach on real surface wave data. Then, we applied 3D gravity modeling based on surface wave analysis results to obtain the density structure of each layer. The reason for using both types of data sets is that the gravity anomaly does not have a good vertical resolution and surface wave group velocities are more appropriate for placing layer limits at depth, but they are not very sensitive to density variations. Therefore, the use of gravity data increases the overall resolution of density distribution. Compared with the Shuffle Complex Evolution (SCE) method that was implemented in a previous study, we found out that the SA method is more stable and has less variability of model parameter values in successive tests. In the final step, we reapplied the SA method to invert the fundamental-mode Rayleigh wave group velocities based on the results of gravity modeling. Gravity results, such as thicknesses and densities were used to limit the search space in the SA method.Our results show that the Moho depth across the Makran subduction zone is increasing from the Oman seafloor (24–30 km) and Makran forearc setting (34–42 km) to the Taftan-Bazman volcanic arc (47–49 km). Also, the results show high shear and compressional velocities under the Gulf of Oman, decreasing to the north of the Makran region. The density image shows an average crustal density with maximum values under the Gulf of Oman, decreasing northward to the Makran region.