The city shall have power, insofar as the exercise thereof shall not conflict with or contravene the provisions of any general law of the state, to acquire by purchase any premises within the city at any tax or other public sale, or by direct purchase from the State of Michigan, or the fee owner, when such purchase is necessary to protect the lien of the city for taxes or special assessments, or both, on said premises, and may hold, lease, or sell the same solely for the purpose of securing therefrom, the amount of such taxes or special assessments, or both, together with any incidental expenses incurred in connection with the exercise of this power. Any such procedure exercised by the city in the protection of its tax lien shall be deemed to be for a public purpose.