The successful implementation of in-situ bioremediation of nonaqueous-phase liquid (NAPL) contamination in soil-groundwater systems is greatly influenced by the migration performance of NAPL-degrading bacteria. However, the impact and mechanisms of NAPL on the migration/retention of pollutant-degrading bacteria remain unclear. This study investigated the migration/retention performance of A. lwoffii U1091, a strain capable of degrading diesel while producing surfactants, in porous media without and with the presence of mono- and multicomponent NAPL (n-dodecane and diesel) under environmentally relevant conditions. The results showed that under all examined conditions (5 and 50 mM NaCl solution at flow rates of 4 and 8 m/d), the presence of n-dodecane/diesel in porous media could reduce the migration and enhance retention of A. lwoffii in quartz sand columns. Moreover, comparing with mutlicomponent NAPLs of n-dodecane, the monocomponent NAPLs (diesel) exhibited a greater reduction effect on the retention of A. lwoffii in porous media. Through systemically investigating the potential mechanisms via tracer experiment, visible chamber experiment, and theoretical calculation, we found that the reduction in porosity, repulsive forces and movement speeds, the presence of stagnant flow zones in porous media, particularly the biosurfactants generated by A. lwoffii contributed to the enhanced retention of bacteria in NAPL-contaminated porous media. Moreover, owing to presence of the greater amount of hydrophilic components in diesel than in n-dodecane, the available binding sites for the adsorption of bacteria were lower in diesel, resulting in the slightly decreased retention of A. lwoffii in porous media containing diesel than n-dodecane. This study demonstrated that comparing with porous media without NAPL contamination, the retention of strain capable of degrading NAPL in porous media with NAPL contamination was enhanced, beneficial for the subsequent biodegradation of NAPL.