Abstract. This study implements the least-squares inversion method for solving the exhumation history from the thermochronologic age–elevation relationship (AER) based on the linear equation among exhumation rate, age and total exhumation from the closure depth to the Earth surface. Modeling experiments suggest significant and systematic influence of initial geothermal model, the a priori exhumation rate and the time interval length on the a posteriori exhumation history. Lessons learned from the experiments include that (i) the modern geothermal gradient can be used for constraining the initial geothermal model, (ii) a relatively high a priori exhumation rate would lead to systematically lower a posteriori exhumation and vice versa, (iii) the variance of the a priori exhumation rate controls the variation in the inverted exhumation history, and (iv) the choice of time interval length should be optimized for resolving the potential temporal changes in exhumation. To mitigate the dependence of inverted erosion history on these initial parameters, we implemented a new stepwise inverse modeling method for optimizing the model parameters by comparing the observed and predicted thermochronologic data and modern geothermal gradients. Finally, method demonstration was performed using four synthetic datasets and three natural examples of different exhumation rates and histories. It is shown that the inverted rock exhumation histories from the synthetic datasets match the whole picture of the “truth”, although the temporal changes in the magnitude of exhumation are underestimated. Modeling of the datasets from natural samples produces geologically reasonable exhumation histories. The code and data used in this work are available on Zenodo (https://doi.org/10.5281/zenodo.10839275).