In arid and semi-arid regions, the adoption of unconventional water sources, including treated domestic wastewater (TWW), as an alternative water resource for crop irrigation has gained widespread attention. Addressing the potential effects of utilizing TWW for irrigation on heavy metal (HM) soil contamination is crucial. Given the escalating apprehensions regarding contamination risks, this study aims to quantitatively analyze the impact of TWW irrigation on the accumulation of HM within soil. The HDRUS-1D model was employed to predict the concentration of HM in soil over a 30-year period. This modeling approach enabled the assessment of HM propagation within the profiles of two TWW irrigated soil types: Calcisol and Fluvisol in Sfax, Tunisia. The simulation results indicate that accumulation of HM increases with time, with the metals gradually penetrating deeper into the soil. In the case of Cr, Cu, and Ni, significant enrichment is observed primarily in the surface layer, while Zn and Fe exhibit enrichment across the entire soil profile. The Fluvisol soil type displays a higher accumulation of HM compared to the Calcisol, particularly in the deep sandy layers. Despite HM concentrations in TWW falling below Tunisian irrigation standards, continuous monitoring of metal accumulation in soil is imperative. The choice of utilizing TWW for irrigation must not only consider water quality but also account for the soil type and its propensity to accumulate heavy metals. Consequently, when considering TWW for irrigation, a comprehensive assessment encompassing water quality, soil characteristics, and potential HM accumulation should be undertaken.