The global demand for petroleum contributes to a significant increase in soil pollution with petroleum-based products that pose a severe risk not only to humans but also to plants and the soil microbiome. The increasing pollution of the natural environment urges the search for effective remediation methods. Considering the above, the objective of this study was to determine the usability of Dactylis glomerata for the degradation of hydrocarbons contained in diesel oil (DO), as well as the effects of both the plant tested and DO on the biochemical functionality and changes in the soil microbiome. The experiment was conducted in a greenhouse with non-polluted soil as well as soil polluted with DO and phytoremediated with Dactylis glomerata. Soil pollution with DO increased the numbers of microorganisms and soil enzymes and decreased the value of the ecophysiological diversity index of microorganisms. Besides, it contributed to changes in the bacterial structure at all taxonomic levels. DO was found to increase the abundance of Proteobacteria and to decrease that of Actinobacteria, Acidobacteria, Chloroflexi, Gemmatimonadetes and Firmicutes. In the non-polluted soil, the core microbiome was represented by Kaistobacter and Rhodoplanes, whereas in the DO-polluted soil, it was represented by Parvibaculum and Rhodococcus. In soil sown with Dactylis glomerata, gasoline fraction (C6–C12) degradation was higher by 17%; mineral oil (C12–C35), by 9%; benzene, by 31%; anthracene, by 12%; chrysene, by 38%; benzo(a)anthracene, by 19%; benzo(a)pyrene, by 17%; benzo(b)fluoranthene, by 15%; and benzo(k)fluoranthene, by 18% than in non-sowed soil. To conclude, Dactylis glomerata proved useful in degrading DO hydrocarbons and, therefore, may be recommended for the phytoremediation of soils polluted with petroleum-based products. It has been shown that the microbiological, biochemical and chemical tests are fast and sensitive in the diagnosis of soil contamination with petroleum products, and a combination of all these tests gives a reliable assessment of the state of soils.