This study relates to the application of newly isolated bacterium, Stenotrophomonas maltophilia strain 5DMD, from the drilled mud of Suleman exploratory oil well no. 1 of Oil and Gas Development Company limited, located at District Khairpur, for biodegradation of two petrochemical hydrocarbons, i.e., diesel oil and used engine oil. The bacterium was identified by routine microbiological techniques followed by the 16S rRNA gene sequencing and homology studies. The experiments were performed using mineral salts medium supplemented with diesel oil and used engine oil as a sole carbon and an energy source under specified culture conditions (35 °C, 160 rpm, 24 days). The hydrocarbon biodegradation rates were estimated in terms of % removal using UV–Vis spectrophotometer, while characteristic spectral changes in both hydrocarbons were confirmed through Attenuated Total Reflectance-Fourier Transform Infrared spectrometry. Consequently, significant degradation rates of 88.5 and 71.8% for were achieved during the experiment. Moreover, the bacterium has also displayed excellent potential for the production of biosurfactants (oil displacement assay = > 6 mm; surface tension = 33.9 and 34.4 m N m−1) and lipase enzyme (Lipolytic zone = 1.8 ± 0.1 cm and 2.2 ± 0.3 cm). Fourier transform infrared spectrometry analyses exhibited substantial changes in % transmittance in the frequency range for characteristic of functional groups of aliphatic (1000–600 and 3000–2800 cm−1) and aromatic (1500–1300 and 1055–1000 cm−1) hydrocarbons in diesel oil and used engine oil, confirming the biodegradation. Therefore, S. maltophilia strain 5DMD could be exploited further for future environmental applications and biosynthesis of surfactants or enzymes.