Accurate estimation of near-surface wind profiles with surface observations is important for evaluating wind resources. Based on the multilayer perceptron algorithm, this study proposes a machine learning (ML) model by establishing the relationship between instantaneous near-surface atmospheric stability (e.g., exponent \(\alpha \) in the power law method) and the mean, change and standard deviation values of the wind speed at 10 m, temperature and relative humidity at 2 m in the past hours. The evaluation results for six wind tower sites in semiarid and arid regions of northwestern China indicate that, compared with the Monin–Obukhov method (e.g., Holtslag in Boundary-Layer Meteorol 29:225–250, 1984), the mean relative errors of near-surface wind speed in the ML model could be reduced by 8.4%, 10.6% and 8.3% at 30 m, 50 m and 70 m, respectively. Further investigations suggest that compared to the MO model, the mean relative errors of near-surface wind profiles in the ML model could be reduced by 2–15% at different wind tower sites and under different near-surface stability conditions. In general, the estimation performance of near-surface wind profiles in the ML model is better under unstable conditions than under stable conditions. Results illuminate that the proposed method using near-surface variables in the past hours as inputs could be an effective way to improve the estimation of near-surface wind profiles.