Bacteria often live in dynamic fluid environments 1-3 and flow can a ect fundamental microbial processes such as nutrient uptake 1,4 and infection 5 . However, little is known about the consequences of the forces and torques associated with fluid flow on bacteria. Through microfluidic experiments, we show that fluid shear produces strong spatial heterogeneity in suspensions of motile bacteria, characterized by up to 70% cell depletion from low-shear regions due to 'trapping' in high-shear regions. Two mathematical models and a scaling analysis accurately capture these observations, including the maximal depletion at mean shear rates of 2.5-10 s −1 , and reveal that trapping by shear originates from the competition between the cell alignment with the flow and the stochasticity in the swimming orientation. We show that this shear-induced trapping directly impacts widespread bacterial behaviours, by hampering chemotaxis and promoting surface attachment. These results suggest that the hydrodynamic environment may directly a ect bacterial fitness and should be carefully considered in the study of microbial processes.We investigated the effect of flow on motile bacteria by tracking them in precisely controlled laminar flows generated in a microfluidic channel (Fig. 1a). To ensure that the dominant velocity gradients occurred in the horizontal observation plane, at the channel mid-depth, we used a microchannel with aspect ratio H /W > 1 (height H = 750 µm; width W = 425 µm). In that plane, the velocity profile, u(y) = U [1 − 4(y/W ) 2 ], where U is the flow velocity at the channel centreline, is parabolic, and, thus, the shear rate S(y) = du/dy = −8yU /W 2 varies linearly with distance y across the channel and is zero at the centreline (Fig. 1b). In this flow, smooth-swimming Bacillus subtilis bacteria swam unperturbed in straight paths (Fig. 1c) when near the centre of the channel, where the local shear rate was small. Conversely, in high-shear-rate regions, trajectories exhibited frequent loops resulting from rotation of the swimming bacteria by the hydrodynamic torque imparted by the local shear (Fig. 1d). The opposite handedness of the loops on either side of the channel centreline reflects the opposite sign of the shear rate (Fig. 1c,d and Supplementary Movie 1). As shown below, these looping trajectories resulted in bacteria becoming trapped in the high-shear region of the channel.At the population scale, this trapping effect resulted in a marked depletion of cells from the central, low-shear region of the flow, and consequently, in an accumulation in the flanking regions of higher shear. When the flow was impulsively started from rest, the initially uniform distribution of cells over the imaging region across the channel width (Fig. 1e) rapidly (5-10 s) evolved into a distribution characterized by considerably fewer cells in the central part of the channel (Fig. 1f-h). The magnitude of the depletion was severe, with local cell concentrations dropping by 70% (Fig. 1h). The absence of depletion in control experime...