Notwithstanding Section 718 of the Civil Code, a city may lease any of its lands to a county, county water authoritiy, or special district for the purpose of constructing, operating, maintaining, and replacing a dam, reservoir, and appurtenant facilities to collect, divert, and store water for all beneficial uses, including development of power, flood control, and recreational uses. The lease may be for any term, but not to exceed the time during which the lands are devoted to the purposes and uses authorized by this section.