This medication is used to treat a variety of bacterial infections. Ofloxacin belongs to a class of drugs called quinolone antibiotics. It works by stopping the growth of bacteria.This antibiotic treats only bacterial infections. It will not work for viral infections (such as common cold, flu). Using any antibiotic when it is not needed can cause it to not work for future infections.