Afforestation in drylands is an effective approach to mitigating soil degradation and erosion while promoting ecological restoration in disturbed ecosystems. This study evaluated the long-term effects of Prosopis juliflora afforestation on soil physical, chemical, and biological properties in Iranian drylands. Four afforested stands representing two age classes (10 and 30 years) and a nearby non-afforested control area were selected. A total of 40 soil samples were collected from two depths (0–15 and 15–30 cm). Soil properties were analyzed using two-way analysis of variance, a generalized linear model, principal component analysis, and Duncan and Tamhane post hoc tests. The interaction between afforestation age and soil depth significantly affected pH, electrical conductivity (EC), total nitrogen (N), organic carbon (OC), sand and silt content, basal respiration, and soil quality index (SQI) (p < 0.05). EC, clay content, and bulk density did not differ significantly between soil depths, whereas saturated moisture point, OC, total nitrogen, available phosphorus, silt content, and basal respiration showed significant depth-related differences. In surface soils (0–15 cm), afforestation age had no significant effect on pH, EC, bulk density, or clay content. However, afforestation improved several soil quality indicators, with fertility enhancement beginning in younger stands and increasing over time. Compared with younger stands, older stands exhibited 45% higher soil C, 33% higher soil N, and a 16% increase in SQI. The afforestation positively influenced soil quality, particularly in surface layers, by enhancing nutrient status and biological activity while contributing to the stabilization of loose sandy soils in arid environments.