The governing authorities of municipalities shall have the power to appoint a fire marshal, who may be the mayor, or any member of the governing authority of the municipality, or the city or town marshal. The fire marshal shall have the power to remove and keep away from the vicinity of any fire all idle and suspicious persons lurking near the same. He shall have the power to compel any person present to aid in the extinguishment of such fire or the preservation of property exposed to the danger of such fire and to aid in preventing goods from being purloined thereat. He shall also have such powers and duties as may be prescribed by ordinance.