Although dumping treated wastewater into soil might provide nutrients and organic matter, it can also expose the ecosystem to biological and chemical risks. A vital indication of soil health and quality is the soil microbial community. The current work used next-generation 16S rRNA gene amplicon sequencing to evaluate the effects of the long-term influx of tertiary treated wastewater (TWW) into Wadi Uranah, a dry valley in Makkah city, Saudi Arabia, on native topsoil bacterial community composition and predicted functions. The findings demonstrated that neither the compositions of microbial communities nor their predicted functions using PICRUSt2 differed significantly (p > 0.05) between polluted valley soil (PolVS) and unpolluted valley soil (UPVS). Alpha and beta diversity, however, showed that the PolVS samples had a considerably higher level of diversity and variability. Firmicutes, Actinobacteria, Proteobacteria, and Bacteroidetes were the most prevalent phyla in both groups. Noticeable relative variations existed in some metabolic pathways such as cofactor, prosthetic group, electron carrier degradation, aldehyde degradation, and Entner-Doudoroff (ED) pathways. Overall, our findings suggest that because both groups have very similar core microbiomes and functions, the long-term disposal of tertiary TWW into Wadi Uranah may have little to no influence on the composition and function of soil bacterial communities. In addition, the long-term discharge of tertiary TWW after partially treated wastewater’s initial disposal may have helped the native soil microbial community recover.