Enterococci bacteria are a frequent cause of catheter-associated urinary tract infections, the most common type of hospital-acquired infection. Treatment has become increasingly challenging because of the emergence of multiantibiotic-resistant enterococcal strains and their ability to form biofilms on catheters. We identified and targeted a critical step in biofilm formation and developed a vaccine that prevents catheter-associated urinary tract infections in mice. In the murine model, formation of catheter-associated biofilms by Enterococcus faecalis depends on EbpA, which is the minor subunit at the tip of a heteropolymeric surface fiber known as the endocarditis- and biofilm-associated pilus (Ebp). We show that EbpA is an adhesin that mediates bacterial attachment to host fibrinogen, which is released and deposited on catheters after introduction of the catheter into the mouse bladder. Fibrinogen-binding activity resides in the amino-terminal domain of EbpA (EbpANTD), and vaccination with EbpA and EbpANTD, but not its carboxyl-terminal domain or other Ebp subunits, inhibited biofilm formation in vivo and protected against catheter-associated urinary tract infection. Analyses in vitro demonstrated that protectionwas associated with a serum antibody response that blocked EbpA binding to fibrinogen and the formation of a fibrinogen-dependent biofilm on catheters. This approach may provide a new strategy for the prevention of catheter-associated urinary tract infections.