Spent mushroom substrate (SMS) holds valuable microbiota that can be useful in remediating polluted soils with hydrocarbons. However, the microorganisms behind the bioremediation process remain uncertain. In this work, a bioremediation assay of total petroleum hydrocarbons (TPHs) polluted soil by SMS application was performed to elucidate the microorganisms and consortia involved in biodegradation by a metabarcoding analysis. Untreated polluted soil was compared to seven bioremediation treatments by adding SMS of Agaricus bisporus, Pleurotus eryngii, Pleurotus ostreatus, and combinations. Soil microbial activity, TPH biodegradation, taxonomic classification, and predictive functional analysis were evaluated in the microbiopiles at 60 days. Different metagenomics approaches were performed to understand the impact of each SMS on native soil microbiota and TPHs biodegradation. All SMSs enhanced the degradation of aliphatic and aromatic hydrocarbons, being A. bisporus the most effective, promoting an efficient consortium constituted by the bacterial families Alcanivoraceae, Alcaligenaceae, and Dietziaceae along with the fungal genera Scedosporium and Aspergillus. The predictive 16 S rRNA gene study partially explained the decontamination efficacy by observing changes in the taxonomic structure of bacteria and fungi, and changes in the potential profiles of estimated degradative genes across the different treatments. This work provides new insights into TPHs bioremediation.