B. Any county, city, or town may contract with the federal or state government to provide emergency medical services to federal or state property located within or without the boundaries of the county, city, or town. In the absence of a written contract, any acts performed and all expenditures made by a county, city, or town in providing emergency medical services to property owned by the federal government shall be deemed conclusively to be for a public and governmental purpose, and all of the immunities from liability enjoyed by a county, city, or town when acting through its emergency medical services personnel for a public or governmental purpose within or without its territorial limits shall be enjoyed by it to the same extent when such county, city, or town is so acting, under the provisions of this section or under other lawful authority. Emergency medical services personnel of any county, city, or town when acting hereunder, or under other lawful authority, shall have all of the immunities from liability and exemptions from laws, ordinances, and regulations and shall have all of the pension, relief, disability, workers' compensation, and other benefits enjoyed by them while performing their respective duties. The amount of compensation to the county, city, or town pursuant to the contract shall be a matter within the sole discretion of the governing body of the county, city, or town.