A urinary tract infection (UTI) is caused by the bacteria Escherichia coli (E. coli) present in the gastrointestinal tract. Harmful bacteria that build up along your urinary tract, which is your body’s drainage system for emptying urine, is one of the most common causes of a UTI. Although these infections are more common in women, they can also affect men.