Most UTIs are caused by bacteria, although they may also be caused by viruses or fungi. Bacteria from the bowel are the most common source of infection. The infection may begin because of any of the following:
Sexual activity. During sex, germs can travel from the penis, vagina, or rectum into the urethra.
Germs on the skin outside the rectum may travel into the urethra. This is more common in women since the rectum and urethra are closer to each other than in men. Wiping from front to back after using the toilet and keeping the area clean can help prevent germs from getting to the urethra.
Blockage of urine flow through the urinary tract. If urine sits too long, germs may begin to grow out of control.
The infection can occur in any part of the urinary tract.
The kidneys collect and store urine.
The ureters carry urine from the kidneys to the bladder.
The bladder holds urine until you are ready to let it out.
The urethra carries urine from the bladder out of the body. It is shorter in women, so bacteria can move through it more easily. The urethra is longer in men, so a UTI is less likely to reach the bladder or kidneys in men.