No claim to any school or public lands by any trespasser thereon by reason of occupancy, cultivation, or improvement thereof shall be recognized; nor shall compensation be made on account of any improvements made by any such trespasser; provided, any person who has heretofore entered upon such land and has made permanent improvements thereon in good faith, for the purpose of residence or cultivation, shall have the right to remove all such improvements therefrom in case he does not become a purchaser or lessee of such lands under the provisions of this code; such removal to be made within sixty days after a sale or lease has been made, as the case may be.
SDCL 5-4-1