The head of any department or agency of the Government of the United States having jurisdiction over public lands and national forests, except national parks and monuments, of the United States is authorized to grant permits, leases, or easements, in return for the payment of a price representing the fair market value of such permit, lease, or easement, to be fixed by such head of such department or agency through appraisal, for a period not to exceed thirty years from the date of any such permit, lease, or easement to States, counties, cities, towns, townships, municipal corporations, or other public agencies for the purpose of constructing and maintaining on such lands public buildings or other public works. In the event such lands cease to be used for the purpose for which such permit, lease, or easement was granted, the same shall thereupon terminate.