The fling-step is a result of the permanent tectonic offset of the ground in the near-fault regions of large earthquakes. Ground motions containing the fling typically feature a one-sided pulse in the velocity and a non-zero permanent displacement (PD) at the end of shaking. Generally, the information regarding PD is not available in many worldwide databases due to the presence of various errors, as well as the limitations of current practices in eliminating the errors that are contained in the raw or unprocessed ground motions. The sources of the errors are usually complex and unpredictable, making the work of retrieving PD challenging. To address this issue, an automated baseline correction approach is proposed to recover the PD of interest. Raw ground motions are first assumed as consisting of the low-frequency (LF) and the high-frequency (HF) contents, with the former and the latter containing the PD and the errors, respectively. The LF contents are extracted from the raw motion by using a modified progressive iterative approach, while the HF contents are filtered to remove the error. The corrected ground motions are then obtained by combining the extracted LF and the filtered HF contents. Ninety-eight ground motions are next identified as containing the fling, and used for validation of the proposed approach. It is shown that the obtained PDs agree well with the geodetic data and existing empirical models, demonstrating the desirable performance of the proposed algorithm. Finally, the effects of baseline corrections on the properties of near-fault ground motions are discussed. The proposed approach does not require the selection of any key time instants that have to be specified in previous studies, thereby avoiding the subjectivity and uncertainty involved in performing relevant algorithms. Besides, it enables an objective criterion for characterizing fling-step ground motions, facilitating the quantitative and systematic investigation of PD. Effective correction of raw ground motions recorded in the near-fault areas is crucial for seismological and earthquake engineering in studying slips on the fault plane, assessing the effect of fling on the seismic hazard, and analyzing the seismic response of near-fault or fault-crossing buildings and infrastructure.