A city to which any territory has been annexed, whether or not said territory has been withdrawn from a district which has authorized the issuance of bonds pursuant to this chapter, and which territory continues to use the works, may contract with the district to pay the district annually or at lesser intervals a sum or sums in lieu of the payment by the owners or residents within said territory of the rates and charges imposed by the district for the use and maintenance of the works.