Most cases of prostatitis are caused by the same bacteria as ordinary urinary infections, not by a sexually transmitted infection. Where they come from, who is at higher risk, and when your doctor tests for gonorrhea or chlamydia.
Dr. Pablo RojasPhysician
In this article
In short: acute prostatitis is almost always caused by the same bacteria as ordinary urinary infections [1]. They reach the prostate by traveling up the urethra, with contaminated urine that flows back, or during a catheter or a biopsy [1]. In the vast majority of cases it isn't something spread through sex: fewer than 1 in 100 cases are due to gonorrhea or chlamydia [1]. Those infections are tested for when there are risk signs, such as several recent partners or discharge from the urethra [1].
If you've just been diagnosed with prostatitis, or your partner has, you're probably wondering where it came from and whether it had anything to do with sex.
What causes prostatitis, and where do the bacteria come from?
Not all prostatitis is an infection: the word is also used for inflammation or pain of the prostate [1]. Here I'm talking about the kind caused by bacteria.
Acute prostatitis is a urinary infection that has also reached the prostate [1]. That's why the germs are, almost always, those of everyday urinary infections:
in 8 or more out of 10 cases, they belong to one group of bacteria, called gram-negative [1];
the most common, Escherichia coli (or E. coli), causes more than half of cases on its own [1].
To reach the prostate, these bacteria have three routes [1]:
Traveling up the urethra, the tube urine flows out through.
Flowing back with the urine. If the urine carries bacteria, it can get into the prostate's small ducts.
Getting in during a procedure, such as a catheter, a camera to look inside the bladder, or a prostate biopsy.
Figure 1. Three routes bacteria take to the prostate. Source: [1].
Sometimes there's no clear cause: acute prostatitis can also appear in a healthy man who hasn't had any procedure [1].
Is prostatitis spread through sex?
In the vast majority of cases, no. Fewer than 1 in 100 cases of acute prostatitis are due to gonorrhea or chlamydia, two sexually transmitted infections [1].
That's why not everyone is tested for them. Your doctor orders a urine test for gonorrhea and chlamydia when there's one of these signs [1]:
you've had two or more sexual partners in less than 6 months;
you have discharge from the urethra.
For example, if a 65-year-old man had a catheter and a few days later develops a fever, it's most likely urinary bacteria. If a 25-year-old has discharge from the urethra and a new partner, that's when gonorrhea and chlamydia are tested for.
But there's an important detail: that figure of fewer than 1 in 100 lumps all men together. In young, sexually active men, when chlamydia and other sexually transmitted bacteria are specifically looked for, they're often found [2]. And having had a sexually transmitted infection before is also a risk factor [2]. If you have a single partner and no discharge from the urethra, these infections aren't tested for to begin with [1].
Most cases of prostatitis don't come from a partner. But you can't say they're never transmitted: if you've had two or more partners in 6 months or have discharge from the urethra, your doctor will test for those infections.
Who is at higher risk of prostatitis?
These are the factors that have been linked to prostatitis:
A procedure on the urinary tract: a cystoscopy (looking inside the bladder with a camera), a catheter or a prostate biopsy [1].
An obstacle to urinating: a prostate that has grown or a narrowing of the urethra [1, 2].
Infections you've already had: urinary or sexually transmitted [2].
Anal sex without a condom [1].
A weakened immune system [1].
A bladder that doesn't work well because of a nerve problem [1].
A prostate that has grown and an inflamed prostate aren't the same, although they're sometimes confused. I explain the difference in inflamed prostate or prostate enlargement.
Can a prostate biopsy cause prostatitis?
Yes. It's one of the situations in which it can appear [1]. And a biopsy done through the rectum raises that risk [3].
The prostate sample can be taken by two routes: through the rectum or through the perineum, the skin between the scrotum and the anus. When the studies that assigned the route at random were pooled, the rectal route had more infection-related complications [3]:
Biopsy route
Infection-related complications
Through the rectum
76 in 2,243 men (about 3 in 100)
Through the perineum
35 in 2,273 men (about 1.5 in 100)
In other words, the rectal route had more than twice as many. If you're going to have a biopsy, you can ask your doctor which route they'll use and why.
And if after a biopsy you have a fever or chills, with or without burning when you urinate, don't wait: go to the emergency room [1]. I go over the warning signs in acute prostatitis: symptoms and when it's an emergency.
Why can prostatitis become chronic?
It's called chronic bacterial prostatitis when the same bacteria persist in the prostate. The clue is that urinary infections keep coming back, always from the same germ [1].
What has been seen more often in men who develop the chronic form [1]:
having had acute prostatitis before;
surgery on the urethra or a catheter;
urine that pools because the bladder doesn't empty well;
anal sex without a condom.
Having acute prostatitis doesn't mean it will become chronic: it's just one of the factors that shows up in men who develop it.
Acute prostatitis is almost always caused by the bacteria of ordinary urinary infections, mainly Escherichia coli.
The bacteria travel up the urethra, arrive with urine that flows back into the prostate, or get in during a catheter, a camera or a biopsy.
Fewer than 1 in 100 cases are due to gonorrhea or chlamydia; if you have risk signs, your doctor will test for them.
Men at higher risk include those who've had urinary tract procedures, an obstacle to urinating, previous infections, anal sex without a condom or a weakened immune system.
A biopsy through the rectum had more than twice as many infections as one through the perineum; you can ask which route will be used.
Frequently asked questions
Can I pass prostatitis on to my partner?
In the vast majority of cases, no: it usually comes from urinary bacteria, not from a sexually transmitted infection [1]. If you've had two or more partners in less than 6 months or have discharge from the urethra, your doctor will test for gonorrhea and chlamydia [1]. If either comes back positive, ask what your partner should do. If you're not sure whether you were tested, ask your doctor.
Can prostatitis be prevented?
Not always: it can appear in a healthy man with no clear cause [1]. What is up to you is avoiding what's been linked to higher risk, such as anal sex without a condom and sexually transmitted infections [1, 2]. And if you have trouble emptying your bladder, tell your doctor: urine that pools has been linked to prostatitis that comes back [1].
Why does a bladder that doesn't empty well favor infections?
One of the risks you saw above is an enlarged prostate that doesn't let the bladder empty well. In this video, under two and a half minutes long, I explain why, in that case, urinary infections keep coming back in men. It's right below.
Still have questions?
Send it anonymously: readers’ questions inspire upcoming answers and articles.
Kulkarni PA, Cortés-Penfield NW, Brehm TJ, Wagenlehner F, Gupta K, Leitner L, et al. State-of-the-art review: diagnosis and management of acute and chronic bacterial prostatitis. Clin Infect Dis. 2026;82(1):1-13. doi:10.1093/cid/ciaf483. PMID: 41657226.
Bonkat G, Kranz J, Cai T, Geerlings SE, Köves B, Lambregts MMC, et al. EAU guidelines on urological infections [Internet]. Edition presented at the EAU Annual Congress, London 2026. Arnhem (The Netherlands): EAU Guidelines Office; 2026 [cited 2026 Nov 15]. ISBN 978-94-92671-32-5. Available from: https://uroweb.org/guidelines/urological-infections
This article is educational and does not replace diagnosis or consultation with a healthcare professional. If you have symptoms, see your doctor.