The present disclosure relates to methods and compositions for the treatment and prevention of microbial infections and for the enhancement of resistance to infection. The disclosure includes administration of an effective amount of an E. coli LpfA antigen to enhance the immune system to prevent infections that cause, e.g., inflammatory bowel diseases, bovine mastitis and metritis. The disclosure also includes methods for diagnosing microbial infection and conditions associated with microbial infection by detecting an E. coli LpfA polypeptide or nucleic acid.