Any city of the fourth class, operating under a home rule charter, may acquire by purchase or condemnation a tract of land not exceeding 25 acres, lying within the corporate limits of the city, and devote the same to the uses of a public park and incidentally may grant to the county agricultural society of the county in which the city is situated the right to hold the annual county fair in the part of the park as shall not interfere with its general usefulness for park purposes.