Flagellar motility enables resource acquisition and noxious substance evasion, underpinning imperative ecological processes in aquatic environments. Yet the underlying mechanism that links flagellar motility with surface attachment and thereby biofilm formation, especially in conditions of limited resource availability, remains elusive. Here, we present experimental and modeling evidence to unveil bacterial motility and biofilm formation under nutrient-limited stresses with Pseudomonas aeruginosa (WT) and its nonflagellated isogenic mutant (ΔfliC) as model bacteria. Results revealed that boosted flagellar motility of WT strain promoted biofilm initialization to a peak value of 0.99 × 107 cells/cm2 at 1/50 dilution after 20 min incubation. We hypothesized that bacteria can invoke instant motility acceleration for survival confronting nutrient-limited stress, accompanied by optimized chemotactic foraging through sensing ambient chemical gradients. Accordingly, accelerated cell motility in oligotrophic environment created increased cell-cell and cell-surface interactions and thereof facilitated biofilm initialization. It was confirmed by the consistence of modeling predictions and experimental results of cell velocity and surface attachment. With the development of biofilm, promotion effect of flagellar motility responding to nutrient deprivation-stress faded out. Instead, loss of motility profiting increased growth rates and extracellular protein excretion, associated with an enhancement of biofilm development for the mutant in oligotrophic aquatic environment. For both strains, nutrient limitation evidently reduced planktonic cell propagation as expected. Our results offer new insights into the mechanical understanding of biofilm formation shaped by environmental stresses and associating biological responses.