Ampicillin is a penicillin antibiotic that is used to treat bacterial infections such as bladder infection, E. coli infection, ear infection, pneumonia, and gonorrhea. This medication kills the bacteria by interfering with the growth of its cell wall.