High-resolution airborne synthetic aperture radar (SAR) systems are very sensible to deviations of the aircraft from the reference track. In high-resolution imagery, the improvement of range resolution increases the difficulty of implementing range cell migration correction (RCMC), while a wider synthetic aperture increases the cumulative time of motion errors which will affect the image quality. To enable accurate motion compensation in image processing, a high-precision navigation system is needed. However, in many cases, due to the limit of accuracy of such systems, motion errors are hard to be compensated correctly, causing mainly the resolution decrease in final image. Moreover, in large swath mode, the range-dependent phase errors are difficult to be compensated by using the conventional autofocus algorithm only. In this paper, we propose a robust motion error estimation method based on raw SAR data. To apply this estimation method, we first estimate the double phase gradients in subaperture. Second, a filtering method based on curve fitting was proposed to reduce the phase estimation errors caused by low signal-to-clutter ratio (SCR). Finally, we propose a weighted total least square method to calculate the motion errors using the filtered phase gradients. Because the proposed algorithm is nonparametric, it can estimate high-order motion errors. This is very important for the airborne SAR, particularly the light aircraft SAR platform, due to their more complicated movement in air turbulence. The versatility that the proposed method can be used in any imaging algorithms is another advantage. The processing of large number of raw SAR data shows that the algorithm is as robust and practical as phase gradient autofocus and can generate better focused images.Index Terms-Autofocus, motion error estimation, phase gradient filtering, synthetic aperture radar (SAR), weighted total least square (WTLS) method.