This study aims to investigate the spatial and temporal dynamics of urban sprawl in Herat City, Afghanistan, from 2000 to 2021 using GIS and remote sensing data (Landsat 7 and 8). In this study, three machine learning algorithms, namely Support Vector Machine (SVM), Random Forest (RF), and Classification and Regression Trees (CART), were employed to classify the study area, and the accuracy of each algorithm for each study period was assessed. Based on the assessment results, the RF algorithm demonstrated higher accuracy and was selected as the classification algorithm. The Google Earth Engine cloud platform was utilized to classify the study area, and the GIS environment was employed for the creation of thematic layers. The analysis revealed a 30.06% increase in built-up areas from 2000 to 2021. Conversely, vegetation, water bodies, and bare land decreased by 8.51%, 1.08%, and 20.53%, respectively, during the same period. The findings indicated that Herat City experienced high-speed expansion between 2000 and 2013, while from 2013 to 2021; it developed at a medium speed. The Relative Shannon's entropy statistical algorithm was employed to quantify urban sprawl, and the results suggest a dispersed urban sprawl pattern. Internal migration to major cities due to conflicts, limited employment opportunities, and inadequate living amenities in rural areas has been a primary driver of urban sprawl in Herat City, Afghanistan.