Surface adhesion of bacteria generally occurs in the presence of shear stress, and the lifetime of receptor bonds is expected to be shortened in the presence of external force. However, by using Escherichia coli expressing the lectin-like adhesin FimH and guinea pig erythrocytes in flow chamber experiments, we show that bacterial attachment to target cells switches from loose to firm upon a 10-fold increase in shear stress applied. Steered molecular dynamics simulations of tertiary structure of the FimH receptor binding domain and subsequent site-directed mutagenesis studies indicate that shear-enhancement of the FimH-receptor interactions involves extension of the interdomain linker chain under mechanical force. The ability of FimH to function as a force sensor provides a molecular mechanism for discrimination between surface-exposed and soluble receptor molecules.