Antibiotics are a commonly prescribed treatment for prostatitis caused by bacteria. The specific antibiotic depends on the type of bacteria present.