
50 Cal.2d 674 (1958)
CITY OF LONG BEACH, Respondent,
v.
BOARD OF SUPERVISORS OF LOS ANGELES COUNTY et al., Appellants.
L. A. No. 24559. 
Supreme Court of California. In Bank.  
Aug. 12, 1958.
 Harold W. Kennedy, County Counsel, and Gordon Boller, Assistant County Counsel, for Appellants.
 Walhfred Jacobson, City Attorney, and John R. Nimocks, Deputy City Attorney, for Respondent.
 SHENK, J.
 This is an appeal by the defendants, the Board of Supervisors of and the County of Los Angeles, from a judgment declaring that real property of the plaintiff city of Long Beach be tax exempt and requiring the defendants to refund taxes collected from the plaintiff.
 The city of Long Beach acquired title to three parcels of land lying outside of its city limits prior to the tax lien date of the first Monday in March, 1954, and title to a fourth parcel similarly located after that date. The county assessed all four parcels for the tax year 1954-1955. After acquisition and prior to the expiration of the tax year, the city annexed all of the parcels and applied to the board of supervisors for a cancellation of the taxes and liens, pursuant to section 4986, *676 subdivision (e) of the Revenue and Taxation Code in effect at that time. That statutory provision provided in its pertinent parts as follows: "All or any portion of any uncollected tax, penalty, or costs, heretofore or hereafter levied, may on satisfactory proof, be canceled by the auditor on order of the board of supervisors with the written consent of the district attorney if it was levied or charged: ... (e) On property acquired after the lien date by the State or by any county, city, school district or other political subdivision and because of this public ownership not subject to sale for delinquent taxes."
 The application for cancellation was denied. The city paid the taxes under protest, filed a verified claim for a refund and, after its denial, commenced this action pursuant to section 5138 of the Revenue and Taxation Code. The complaint sought declaratory relief contending that the supervisors should have allowed the claim, and sought to recover the taxes paid. The defendants demurred, were overruled with leave to answer but decline to do so. The ensuing judgment awarded the relief sought.
 [1] Section 1 of article XIII of the Constitution, prior to 1914, exempted from general taxation property belonging to a municipal corporation wherever located. In that year an amendment was adopted which eliminated from the exemption "such lands and the improvements thereon located outside of the county, city and county or municipal corporation owning the same as were subject to taxation at the time of the acquisition of the same by said county, city and county, or municipal corporation. ..." In construing that section it was said in County of Mariposa v. Merced Irr. Dist., 32 Cal.2d 467, at page 473 [196 P.2d 920]: "The constitutional amendment puts two qualifications on lands which are excluded from the exemption. They must be outside the municipal corporation and such 'as were subject to taxation at the time of the acquisition of the same' by the municipal corporation. Manifestly, the phrase 'at the time of acquisition of the same' refers to and modifies only the clause 'as were subject to taxation' and not the clause 'located outside of the ... corporation owning the same.' That is to say, the amendment does not mean that property located outside the boundaries at the time of acquisition is taxable even though later included within the boundaries of the corporation, while property inside the corporation at the time of the acquisition is not taxable." [2] Thus it appears to be settled that municipal property *677 once subject to taxation as being outside the municipal limits becomes exempt when annexed to that municipal corporation. The question is whether, upon qualification for exemption, preexisting tax liens on the property cease to exist.
 Prior to the 1914 amendment the exemption was held to be effective as to existing tax liens upon acquisition of lands by a municipal corporation. Thus in Smith v. City of Santa Monica, 162 Cal. 221 [121 P. 920], the city acquired lands against which there were existing tax liens for unpaid assessments for three years prior to the date of acquisition. It was concluded that the liens were eliminated as having been absorbed in the city's title. The court stated that: "The reasoning leading irresistibly to this conclusion is well set forth in People v. McCreery, 34 Cal. 432; People v. Doe, 36 Cal. 220; Low v. Lewis, 46 Cal. 552, and Doyle v. Austin, 47 Cal. 360. That reasoning is that wherever a municipal corporation or public agency of the state owns real property used for the purposes of such agency, the ultimate title is in the state itself. The agency holds the title upon the two-fold trust, the one for the public, the other for the state, and that to countenance taxation of such property would be to countenance the folly of the sovereign taxing its own property 'and taking money out of one pocket to put in another.' In People v. Doe, 36 Cal. 220, summing up the reasoning, it is said: 'The constitution and laws upon the subject of taxing property are, therefore, to be understood as referring to private property and persons, and not including public property and the state, or any subordinate part of the state government, such as counties, towns and municipal corporations.' ... The state does not tax the property of a municipality for state and county purposes because this would be a taxation of its own property."
 The concept that a municipality should not be taxed for county purposes was held, in the foregoing case of Smith v. City of Santa Monica to apply to assessments and liens established against the property prior to the acquisition of the property by the municipality and remaining unpaid. The test of exemption at that time was ownership. (Anderson-Cottonwood Irr. Dist. v. Klukkert, 13 Cal.2d 191, 198 [88 P.2d 685]; Sutter-Yuba Inv. Co. v. Waste, 52 Cal.App.2d 785, 790 [127 P.2d 25].) [3] The purpose of the amendment in 1914 was primarily to safeguard the tax revenues of small counties wherein a large municipal corporation might acquire extensive holdings not located within the boundaries of the municipal *678 corporation. (City & County of San Francisco v. County of Alameda, 5 Cal.2d 243, 245-246 [54 P.2d 462].) By the amendment certain properties were removed from the exemption during such times as they could not qualify therefor. [4] But upon qualification it appears that the rules governing the application of the exemption should be the same as those existing as to properties upon qualification for the exemption prior to the amendment. There is nothing in the amendment which would indicate otherwise. Accordingly, when the properties were annexed by the plaintiff city as in the present case they were in legal effect discharged from existing tax liens. (See City of Los Angeles v. Ford, 12 Cal.2d 407 [84 P.2d 1042]; Smith v. City of Santa Monica, supra, 162 Cal. 221; People v. Board of Supervisors, 126 Cal.App. 670 [15 P.2d 209].)
 The defendants claim that there are "vested rights" in a tax lien once established which cannot be extinguished when lands subject to the lien qualify for the exemption. They rely on Rock Creek Water Dist. v. County of Calaveras, 133 Cal.App.2d 141 [283 P.2d 740]. In that case the Rock Creek Water District, located in Stanislaus County, in December 1948 purported to annex lands lying in Calaveras County. That county continued to tax the lands through 1952. The district paid the taxes and sued for a refund. Recovery was allowed as to the tax years after the 1949-1950 tax year but not allowed as to the 1949- 1950 tax payment on the ground that the annexation proceedings of 1948 had not been conducted according to law and were of no effect without the enactment of a validating act, effective on June 30, 1949. It was held, however, that the validating act was ineffective to defeat the "vested right" in the tax lien established prior thereto. The Rock Creek case does not turn upon the effect of annexation as to an existing lien, but upon the effect of the validating act and rests upon the assumption that the tax lien constituted a vested right. In Oakdale Irr. Dist. v. County of Calaveras, 133 Cal.App.2d 127 [283 P.2d 732], decided on the same day as the Rock Creek Water District case, the same court held that lands included within an irrigation district after the tax lien date, were exempt from taxation. Again, the court did not discuss the effect of annexation upon an existing lien, and neither of the cases can be considered as authority upon that subject.
 The defendants also rely on City of Santa Monica v. Los *679 Angeles County, 15 Cal.App. 710 [115 P. 945], where the city acquired property after the lien date and paid the taxes in that year under protest. It was held that the city could not recover the taxes because they properly became a lien in the first instance. That decision has been distinguished on grounds that thereafter statutory provisions were enacted which required the cancellation of the tax lien on proper application. (People v. Board of Supervisors, supra, 126 Cal.App. 670.) Moreover, it would appear that the qualification of land for the constitutional exemption from taxation, including existing tax liens, in and of itself, would render the collection of such taxes improper aside from the administrative cancellation of taxes once properly levied. If that were not so, it would follow that the collection of taxes on property declared by the Constitution to be tax exempt would be proper. [5] While it may be desirable and more orderly that a cancellation be obtained, the failure to do so cannot make valid a tax lien on property constitutionally exempt from taxation.
 It is also contended by the defendants that the plaintiff is not entitled to a recovery of the taxes paid under the statutory procedures pursued by it. The rule of exemption has been implemented by statute. The language of section 4986 of the Revenue and Taxation Code provides that a tax "may" be cancelled if levied on property acquired "after the lien date." It is claimed that the duty of cancellation did not exist at the time of the application as to the three parcels acquired before the lien date, and that the question of cancellation and the propriety of the supervisors' failure to act is now moot. [6] As above pointed out, section 4986 authorizes cancellations only in cases where there is "any uncollected tax. ..." In the present case payment has already been made and the action is one to recover.
 The foregoing contentions based on the claimed inapplicability of the cancellation provisions need not be determined in view of the effect to be given to the constitutional provision. As stated, the qualification of the parcels herein involved for the constitutional exemption rendered the collection of existing taxes improper aside from implementing legislation for the cancellation of the tax. [7] Section 5096 of the Revenue and Taxation Code provides in part as follows: "On order of the board of supervisors, any taxes paid before or after delinquency shall be refunded if they were: ... (b) Erroneously or illegally collected." It is sufficient that the *680 collection, as distinguished from the original assessment, be erroneous or illegal. (Evans v. County of San Joaquin, 67 Cal.App.2d 452, 454-455 [154 P.2d 468].) [8] Where taxes are paid under protest on property entitled to exemption the refund is in order upon the filing of a proper and timely claim. (See S. Siwel Co. v. County of Los Angeles, 27 Cal.2d 724, 731 [167 P.2d 177].) Whether cancellation was available or had been denied would seem to be immaterial. [9] The exemption was applicable when the property became qualified upon annexation, and the existing liens on each of the four parcels of property and the city's tax liabilities as of that date, regardless of the date of acquisition of each of the parcels by the city, disappeared.
 [10] Contentions that mandamus is the remedy which the plaintiff city should have pursued to compel cancellation, are without merit. In Security-First Nat. Bank v. Board of Supervisors, 35 Cal.2d 323 [217 P.2d 948], it was held that a writ of mandate would not lie to compel, under section 4986 of the Revenue and Taxation Code, the cancellation of taxes improperly levied where the petitioner had an adequate remedy at law by an action for refund of taxes alleged to have been erroneously collected. (See also Vista Irr. Dist. v. Board of Supervisors, 32 Cal.2d 477 [196 P.2d 926].)
 The judgment is affirmed.
 Gibson, C.J., Carter, J., Traynor, J., Schauer, J., Spence, J., and McComb, J., concurred.
