Key takeaways
There’s no evidence that UTIs directly cause erectile dysfunction, but the two conditions can sometimes be connected.
So-called UTI erectile dysfunction may be due to UTI-related pain, stress over UTI symptoms, prostatitis, or an underlying condition that causes both UTIs and ED.
Men with urinary symptoms may be more likely to experience ED symptoms if they also have common ED risk factors such as age over 40, an enlarged prostate, hypertension, diabetes, or heart disease.
UTIs are typically treated with antibiotics, but the best treatment for ED typically involves lifestyle interventions, PDE5 inhibitors, or both.
Here's what we'll cover
Here's what we'll cover
Here's what we'll cover
Key takeaways
There’s no evidence that UTIs directly cause erectile dysfunction, but the two conditions can sometimes be connected.
So-called UTI erectile dysfunction may be due to UTI-related pain, stress over UTI symptoms, prostatitis, or an underlying condition that causes both UTIs and ED.
Men with urinary symptoms may be more likely to experience ED symptoms if they also have common ED risk factors such as age over 40, an enlarged prostate, hypertension, diabetes, or heart disease.
UTIs are typically treated with antibiotics, but the best treatment for ED typically involves lifestyle interventions, PDE5 inhibitors, or both.
Urinary tract infections (UTIs) can certainly make life uncomfortable. But can a UTI cause erectile dysfunction (ED)? The short answer is no — at least not directly. Though there’s no evidence that UTIs cause ED, urinary tract symptoms and sexual dysfunction can occur at the same time and may share underlying causes.
Read on for a closer look at the potential relationship between a UTI and erectile dysfunction, including how to get a diagnosis and the right treatment.
Can a UTI cause erectile dysfunction — and if so, how?
There’s no evidence that UTIs cause ED. But erection problems and UTIs can go hand in hand, especially if the UTI is particularly painful, stressful, or linked to an underlying condition that also affects sexual function.
Here are some potential reasons having a UTI may impede erectile function:
Physical pain or discomfort. UTIs can cause pelvic pain, pain during urination and pain during ejaculation — pain can impact sexual performance, including the ability to get or maintain an erection.
Psychological factors. Stress and anxiety over painful ejaculation or frequent urges to urinate can cause temporary psychological ED.
Prostatitis (prostate inflammation). UTIs can trigger prostatitis — inflammation of the prostate gland that is independently associated with erectile dysfunction. Prostate inflammation may also affect blood vessel health and can affect blood flow to the penis, which could affect erectile function over time.
Benign prostatic hyperplasia (BPH). Men with BPH, or enlarged prostate, have a higher risk of both UTIs and erectile dysfunction — meaning their chronic condition, rather than a bladder infection, may be contributing to ED symptoms.
How common is ED during or caused by a UTI?
There’s simply not enough data on UTI-specific ED to know how common ED is during a UTI. Individual risk of ED depends on several factors, from age to blood pressure.
In general, the risk of ED with a UTI increases with:
Severe urinary symptoms
Untreated UTIs (if they lead to prostatitis or chronic symptoms)
Diagnosis of prostatitis, hypertension, diabetes, or heart disease
Age (since risk of ED increases as you get older)
How long does ED last after a UTI?
UTI erectile dysfunction — meaning ED symptoms that are caused by pain or swelling from a urinary tract infection — should subside once the infection clears. For men, that’s usually 7 days for a simple bladder infection, though treatment may be extended to 14 days in some cases.
If ED symptoms persist weeks after the infection clears, it’s worth discussing with a healthcare provider. Many factors can affect erectile function, from stress to testosterone levels. It’s also important to rule out underlying conditions that contribute to ED, such as high cholesterol, atherosclerosis (clogged arteries), and diabetes.
Diagnosing a UTI and erectile dysfunction
A UTI may not directly cause ED, but the two conditions can be related. Anyone experiencing symptoms of either should speak with a healthcare provider and be prepared to discuss their medical history and symptoms.
UTI symptoms | ED symptoms |
· Burning pain while peeing · Frequent urge to pee · Pressure, pain, or cramping in the groin or lower belly · Painful ejaculation (which may suggest prostatitis rather than a typical UTI) | · Difficulty getting an erection · Easily losing an erection |
Getting diagnosed with a UTI, ED, or both requires consulting a licensed healthcare provider. Be prepared to discuss:
Medical history
Sexual history and habits
Symptoms (what they are, how bad they are, and when they started)
Current medications
It’s also important to share information aboutalcohol, tobacco, and other substance use, which can affect erectile function.
Diagnosing a UTI or ED also requires a physical examination and labwork, such as blood tests, a urine sample, and — in some cases — ultrasound imaging.
How to treat a UTI (in men)
UTI treatment in men differs from women in important ways. Because UTIs in men can involve the prostate and have a higher risk of complications, treatment courses are typically longer and urine culture with specific antibiotic testing is recommended to guide antibiotic selection.
Below, let’s unpack the most common antibiotics for UTIs in men.
Trimethoprim-sulfamethoxazole (TMP-SMX, TMP-SMZ)
This antibiotic combines two medications, trimethoprim and sulfamethoxazole. It is an older antibiotic that is considered a first-line treatment for lower-risk UTIs in men. It is often prescribed for 7 days in men (compared to 3 days for women)
TMP-SMX has several benefits: it’s affordable, effective against most UTIs, and can be taken with or without food. Brand-name versions include Bactrim and Sulfatrim.
Nitrofurantoin
Nitrofurantoin is a common treatment for uncomplicated lower urinary tract infections in men. It affects bacterial metabolism and cell wall synthesis.
Like trimethoprim-sulfamethoxazole, this antibiotic is older and affordable. Some people may also prefer it because it does not significantly affect gut bacteria — meaning it may be less likely to cause diarrhea than other antibiotics. However, it shouldn’t be used if prostatitis is suspected or if there is a concern that the urinary infection has reached the kidney (pyelonephritis).
Nitrofurantoin is also sold under the brand names Macrodantin, Macrobid, and Furadantin.
Fluoroquinolones
Fluoroquinolones like ciprofloxacin and levofloxacin are commonly used in men with UTIs, particularly for pyelonephritis or when prostatitis is suspected. However, these antibiotics can come with more severe side effects such as tendon damage and effects on heart rhythm and are generally reserved for situations when first-line antibiotics are not appropriate. not considered first-line treatments for uncomplicated UTIs.
These are not the only antibiotics available for UTIs. In some cases, bacteria may be resistant to first-line antibiotics, which is why urine culture and further testing are important, especially in men or people with frequent infections. If symptoms continue despite antibiotic treatment, a healthcare provider may need to adjust your antibiotic.
How to treat ED caused by a UTI (or otherwise)
Treating ED symptoms caused or worsened by a UTI may simply require treating the UTI. But what if you’re still experiencing ED after treating a UTI? There are solutions — and most start by consulting a healthcare provider.
Here are some science-backed ED treatments:
Prioritize your physical health
This means following a healthy eating plan and exercising regularly. A sedentary lifestyle can contribute to erectile problems, and research shows that regular physical activity can help improve ED symptoms regardless of body weight.
Ultimately, addressing an unhealthy eating pattern or sedentary lifestyle can support better erectile function over time.
Remember your mental health
Stress-induced ED can happen, and UTIs aren’t the only stressor in life. Any underlying stress and anxiety can contribute to ED. Sometimes, mental health stressors can be managed with therapy or mindfulness exercises.
In some cases, a healthcare provider might recommend treatment for depression, anxiety, or other mood disorders. Mental health, like sexual health, requires an individualized approach.
Screen for underlying health conditions
Urinary tract infections don’t directly cause ED, but many health conditions do contribute to erectile dysfunction.
Anyone who hasn't had a physical exam or lab work done recently should consider scheduling an appointment. Treating underlying health conditions — e.g., enlarged prostate, high blood pressure, high cholesterol, diabetes — can go a long way toward maintaining erectile health. Left unaddressed, these issues can worsen over time and prolong sexual performance problems.
Ask your provider about prescription medications
There are prescription medications for ED. First-line options such as Viagra (sildenafil) and Cialis (tadalafil) belong to a class of drugs called phosphodiesterase type 5 inhibitors (PDE5 inhibitors). PDE5 inhibitors don’t trigger spontaneous erections. Instead, they improve blood flow to the penis for harder, longer-lasting erections during arousal.
Sildenafil and tadalafil are also available in forms that are not FDA-approved themselves (but contain active ingredients that are FDA-approved). These include Ro’s Daily Rise Gummies and dissolvable Ro Sparks.
Bottom line
Can a UTI cause erectile dysfunction? Not directly — this is a matter of correlation, not causation. Here’s a quick recap:
UTIs and erectile dysfunction are connected. Men with UTIs may be more likely to develop ED symptoms if the urinary symptoms are severe and the person is older or has underlying health conditions.
UTIs can impede erectile function in a few ways. UTIs are often painful,which can affect physical intimacy. Frequent urges to urinate can also be stressful, contributing to psychological ED.
Some conditions increase the risk of both UTIs and ED. Both issues are more likely as you get older, and an enlarged prostate (also more likely with age) can contribute to both conditions, too.
There are ways to treat both. A healthcare provider will likely recommend antibiotics for the UTI and lifestyle changes, prescription ED treatment, or both to support stronger, longer-lasting erections.
Frequently asked questions (FAQs)
Can men get a UTI from sex?
It’s unlikely but possible. UTIs are not sexually transmitted infections. But sexual partners might share UTI-causing bacteria during intimate contact, especially during anal sex.
Does ejaculating make a UTI worse in a male?
There’s no evidence that ejaculating makes a UTI worse. On the other hand, a UTI can trigger premature ejaculation and pain during ejaculation — issues that should resolve once the infection is treated.
DISCLAIMER
If you have any medical questions or concerns, please talk to your healthcare provider. The articles on Health Guide are underpinned by peer-reviewed research and information drawn from medical societies and governmental agencies. However, they are not a substitute for professional medical advice, diagnosis, or treatment.
Cialis Important Safety Information: Read more about serious warnings and safety info.
Viagra Important Safety Information: Read more about serious warnings and safety info.
References
Allen, M. S., Wood, A. M., & Sheffield, D. (2023). The Psychology of Erectile Dysfunction. Current Directions in Psychological Science, 32(6), 487-493. doi: 10.1177/09637214231192269. Retrieved from https://journals.sagepub.com/doi/full/10.1177/09637214231192269#
Bono, M.J. & Leslie, S.W. (2025). Uncomplicated Urinary Tract Infections. StatPearls. Retrieved from https://www.ncbi.nlm.nih.gov/books/NBK470195/
Borgert, B. J., Wallen, E. M., & Pham, M. N. (2025). Prostatitis: A Review. JAMA, 334(11), 1003–1013. doi: 10.1001/jama.2025.11499. Retrieved from https://pubmed.ncbi.nlm.nih.gov/40788632/
Brookes, S. T., Donovan, J. L., Peters, T. J., Abrams, P., & Neal, D. E. (2002). Sexual dysfunction in men after treatment for lower urinary tract symptoms: evidence from randomised controlled trial. BMJ (Clinical research ed.), 324(7345), 1059–1061. doi: 10.1136/bmj.324.7345.1059. Retrieved from https://pmc.ncbi.nlm.nih.gov/articles/PMC104331/
Centers for Disease Control and Prevention. (2024). Urinary Tract Infection Basics. Retrieved from https://www.cdc.gov/uti/about/index.html
Dijkmans, A. C., Zacarías, N. V. O., Burggraaf, J., Mouton, J. W., Wilms, E. B., van Nieuwkoop, C., Touw, D. J., Stevens, J., & Kamerling, I. M. C. (2017). Fosfomycin: Pharmacological, Clinical and Future Perspectives. Antibiotics (Basel, Switzerland), 6(4), 24. doi: 10.3390/antibiotics6040024. Retrieved from https://pmc.ncbi.nlm.nih.gov/articles/PMC5745467/
Foxman, B., Manning, S. D., Tallman, P., Bauer, R., Zhang, L., Koopman, J. S., Gillespie, B., Sobel, J. D., & Marrs, C. F. (2002). Uropathogenic Escherichia coli are more likely than commensal E. coli to be shared between heterosexual sex partners. American journal of epidemiology, 156(12), 1133–1140. doi: 10.1093/aje/kwf159. Retrieved from https://academic.oup.com/aje/article/156/12/1133/151795
Glina, S., & Glina, F. P. (2013). Pathogenic mechanisms linking benign prostatic hyperplasia, lower urinary tract symptoms and erectile dysfunction. Therapeutic Advances in Urology, 5(4), 2doi: https://doi.org/10.1177/1756287213488236. Retrieved from https://pmc.ncbi.nlm.nih.gov/articles/PMC3721438/
Kalaitzidou, I., Venetikou, M. S., Konstadinidis, K., Artemiadis, A. K., Chrousos, G., & Darviri, C. (2014). Stress management and erectile dysfunction: a pilot comparative study. Andrologia, 46(6), 698–702. doi: /10.1111/and.12129. Retrieved from https://pubmed.ncbi.nlm.nih.gov/23822751/
Kemnic, T.R., Coleman, M.(2022). Trimethoprim Sulfamethoxazole. StatPearls Publishing. Retrieved from https://www.ncbi.nlm.nih.gov/books/NBK513232/
Kim S. W. (2011). Prostatic disease and sexual dysfunction. Korean Journal of Urology, 52(6), 373–378. doi: 10.4111/kju.2011.52.6.373. Retrieved from https://pmc.ncbi.nlm.nih.gov/articles/PMC3123811/
Krzastek, S. C., Bopp, J., Smith, R. P., & Kovac, J. R. (2019). Recent advances in the understanding and management of erectile dysfunction. F1000Research, 8, F1000 Faculty Rev-102. doi: 10.12688/f1000research.16576.1. Retrieved from https://pmc.ncbi.nlm.nih.gov/articles/PMC6348436/
Leslie, S.W. & Sooriyamoorthy, T. (2024). Erectile Dysfunction. StatPearls. Retrieved from https://www.ncbi.nlm.nih.gov/books/NBK562253
Lipsky B. A. (1999). Prostatitis and urinary tract infection in men: what's new; what's true?. The American Journal of Medicine, 106(3), 327–334. doi: 10.1016/s0002-9343(99)00017-0. Retrieved from https://pubmed.ncbi.nlm.nih.gov/10190383/
McMahon C. G. (2019). Current diagnosis and management of erectile dysfunction. The Medical Journal of Australia, 210(10), 469–476. doi: 10.5694/mja2.50167. Retrieved from https://pubmed.ncbi.nlm.nih.gov/31099420/
MedlinePlus. (2024). Urinary tract infections (adult). Retrieved on March 31, 2026, from https://medlineplus.gov/ency/article/000521.htm
Mohsen, S., Dickinson, J. A., & Somayaji, R. (2020). Update on the adverse effects of antimicrobial therapies in community practice. Canadian Family Physician Medecin de Famille Canadien, 66(9), 651–659. Retrieved from https://pmc.ncbi.nlm.nih.gov/articles/PMC7491661/
National Institute of Diabetes and Digestive and Kidney Diseases. (2024). Diagnosis of Erectile Dysfunction. Retrieved on March 31, 2026, from https://www.niddk.nih.gov/health-information/urologic-diseases/erectile-dysfunction/diagnosis
Nickel, J. C., Elhilali, M., Vallancien, G., & ALF-ONE Study Group (2005). Benign prostatic hyperplasia (BPH) and prostatitis: prevalence of painful ejaculation in men with clinical BPH. BJU International, 95(4), 571–574. doi: 10.1111/j.1464-410X.2005.05341.x. Retrieved from https://pubmed.ncbi.nlm.nih.gov/15705082/
Nimbi, F. M., Rossi, V., Tripodi, F., Luria, M., Flinchum, M., Tambelli, R., & Simonelli, C. (2020). Genital Pain and Sexual Functioning: Effects on Sexual Experience, Psychological Health, and Quality of Life. The Journal of Sexual Medicine, 17(4), 771–783. doi: 10.1016/j.jsxm.2020.01.014. Retrieved from https://pubmed.ncbi.nlm.nih.gov/32063471/
Sabih A, Leslie SW. (2024). Complicated Urinary Tract Infections. StatPearls. Retrieved from https://www.ncbi.nlm.nih.gov/books/NBK436013/
Sihotang, R. C., Alvonico, T., Taher, A., Birowo, P., Rasyid, N., & Atmoko, W. (2021). Premature ejaculation in patients with lower urinary tract symptoms: a systematic review. International Journal of Impotence Research, 33(5), 516–524. doi: 10.1038/s41443-020-0298-5. Retrieved from https://pubmed.ncbi.nlm.nih.gov/32393845/
Squadrito, F.J. & del Portal, D. (2023). Nitrofurantoin. StatPearls. Retrieved from https://www.ncbi.nlm.nih.gov/books/NBK470526
Waqar, M., Omar, K., Moubasher, A., Brunckhorst, O., & Ahmed, K. (2020). Painful Ejaculation - An Ignored Symptom. Cureus, 12(10), e11253. doi: 10.7759/cureus.11253. Retrieved from https://pmc.ncbi.nlm.nih.gov/articles/PMC7707127/
Yan, A. & Bryant, E.E. (2023). Quinolones. StatPearls. Retrieved from https://www.ncbi.nlm.nih.gov/books/NBK557777/












