Ampicillin is an antibiotic. It is used for the treatment of bacterial infections that affects your lungs, nose, throat, urinary tract, stomach, and intestine, etc. It works by preventing the formation of the protective outer layer of the bacteria and kills them.