Flagyl can be used to treat certain problems brought about by bacteria and different organisms in various elements of the body. It is also used to prevent or treat certain problems that may occur during surgery. Flagyl is definitely an antibiotic that belongs to a group of drugs labeled nitroimidazoles. This medicine works by killing or stopping the growth of bacteria and some other organisms causing these problems. The physician could have given Flagyl for another reason.