All cities and towns having a population of more than one thousand, and all towns and villages in this state having a population of one thousand or less and situated within three miles of the corporate limits of any city having a population of twenty-five thousand or more, may regulate, restrict, and prohibit by proper ordinances, the running at large of livestock of all kinds within the corporate limits of the cities, towns, and villages; establish impounding pens and yards, and employ pound keepers; fix impounding fees and charges; and provide for the sale or disposition of impounded animals or stock.