AbstractUnderstanding the spatiotemporal behaviour of soil moisture in tropical forests is fundamental because it mediates processes such as infiltration, groundwater recharge, runoff and evapotranspiration. This study aims to model the spatiotemporal dynamics of soil moisture in an Atlantic forest remnant (AFR) through four machine learning algorithms, as these dynamics represent an important knowledge gap under tropical conditions. Random forest (RF), support vector machine, average neural network and weighted k‐nearest neighbour were studied. The abilities of the models were evaluated by means of root mean square error, mean absolute error, coefficient of determination (R2) and Nash‐Sutcliffe efficiency (NS) for two calibration approaches: (a) chronological and (b) randomized. The models were further compared with a multilinear regression (MLR). The study period spans from September 2012 to November 2019 and relies on variables representing the weather, geographical location, forest structure, soil physics and morphology. RF was the best algorithm for modelling the spatiotemporal dynamics of the soil moisture with an NS of 0.77 and R2 of 0.51 in the randomized approach. This finding highlights the ability of RF to generalize a dataset with contrasting weather conditions. Kriging maps highlighted the suitability of RF to track the spatial distribution of soil moisture in the AFR. Throughfall (TF), potential evapotranspiration (ETo), longitude (Long), diameter at breast height (DBH) and species diversity (H) were the most important variables controlling soil moisture. MLR performed poorly in modelling the spatiotemporal dynamics of soil moisture due to the highly nonlinear condition of this process.Highlights Modelling soil moisture in an Atlantic forest through machine learning. Machine learning algorithms are powerful tools to address the spatiotemporal dynamics of soil moisture. Climate, position and forest variables drive the spatiotemporal pattern of soil moisture. Random forest is the best algorithm to simulate soil moisture dynamics.