Multipath is the main unmodeled error source hindering high-precision Global Navigation Satellite System data processing. Conventional multipath mitigation methods, such as sidereal filtering (SF) and multipath hemispherical map (MHM), have certain disadvantages: They are either not easy to use or not effective enough for multipath mitigation. In this study, we propose a machine learning (ML)-based multipath mitigation method. Multipath modeling was formulated as a regression task, and the multipath errors were fitted with respect to azimuth and elevation in the spatial domain. We collected 30 days of 1 Hz GPS data to validate the proposed method. In total, five short baselines were formed and multipath errors were extracted from the postfit residuals. ML-based multipath models, as well as observation-domain SF and MHM models, were constructed using 5 days of residuals before the target day and later applied for multipath correction. It was found that the XGBoost (XGB) method outperformed SF and MHM. It achieved the highest residual reduction rates, which were 24.9%, 36.2%, 25.5% and 20.4% for GPS P1, P2, L1 and L2 observations, respectively. After applying the XGB-based multipath corrections, kinematic positioning precisions of 1.6 mm, 1.9 mm and 4.5 mm could be achieved in east, north and up components, respectively, corresponding to 20.0%, 17.4% and 16.7% improvements compared to the original solutions. The effectiveness of the ML-based multipath model was further validated using 30 s sampling data and data from a low-cost device. We conclude that the ML-based multipath mitigation method is effective, easy to use, and can be easily extended by adding auxiliary input features, such as signal-to-noise ratio, during model training.