Uropathogenic E. coli (UPEC), which cause urinary tract infections (UTI), utilize type 1 pili, a chaperone usher pathway (CUP) pilus, to cause UTI and colonize the gut. The pilus rod, comprised of repeating FimA subunits, provides a structural scaffold for displaying the tip adhesin, FimH. We solved the 4.2 Å resolution structure of the type 1 pilus rod using cryo-electron microscopy. Residues forming the interactive surfaces that determine the mechanical properties of the rod were maintained by selection based on a global alignment of fimA sequences. We identified mutations that did not alter pilus production in vitro but reduced the force required to unwind the rod. UPEC expressing these mutant pili were significantly attenuated in bladder infection and intestinal colonization in mice. This study elucidates an unappreciated functional role for the molecular spring-like property of type 1 pilus rods in host-pathogen interactions and carries important implications for other pilus-mediated diseases.