
41 Cal.2d 698 (1953)
ERNEST TERRY, Respondent,
v.
CITY OF BERKELEY et al., Appellants.
S. F. No. 18585. 
Supreme Court of California. In Bank.  
Nov. 25, 1953.
 Fred C. Hutchinson, City Attorney, and Robert T. Anderson, Deputy City Attorney, for Appellants.
 Cornish & Cornish, Francis T. Cornish, Howard W. Wayne and Robert H. Kroninger for Respondent.
 SHENK, J.
 This is an appeal from a judgment for the plaintiff in a action by a retired police officer for declaratory relief and for an accumulated amount alleged to be due him from a pension fund pursuant to an ordinance of the defendant city of Berkeley.
 The plaintiff was a member of the Police Department of the city of Berkeley from August, 1925, to May 1, 1940, when he was retired because of physical disability incurred in the line of duty. At the time of his retirement and for more than three years immediately prior thereto he held the rank of "Mounted Patrolman" and received the salary attached to that rank of $185 per month. At that time Berkeley Ordinance No. 2250-N.S. provided that under the conditions applicable to the plaintiff's retirement a pension would be paid during the period of his disability. Section 13 of the ordinance fixed the amount of the pension in the following language: "... he shall be paid from the Fund during the period of his disability a pension equal to one-half of the average salary attached to the rank or ranks held during the three years immediately preceding the date of retirement. ..." Accordingly, the plaintiff's pension was determined to be $92.50 a month at the time of his retirement, and payments of that amount were made to him. Shortly after his retirement the salary attached to the rank of mounted patrolman was increased and additional periodic increases later became effective. Finally, in February, 1951, subsequent to the commencement of this action, the salary was increased to $334.80 per month. The amounts received by the plaintiff have remained at $92.50 a month. He asserts that he is and has been entitled to one-half of the fluctuating salary attached to the rank he held rather than to one-half the monthly amount paid to him during the three years immediately prior to his retirement. The trial court agreed with the interpretation of section 13 asserted by the plaintiff and awarded to him the sum of $3,095.74, the difference between $92.50 and one-half of the salary attached to the rank of mounted patrolman for the years within the period of the statute of limitations and the elapsed time since the filing of *700 the complaint. In addition the court awarded in his favor the declaratory relief sought by the plaintiff as to future payments.
 The question involves the construction of section 13 prior to its amendment as hereinafter indicated. More precisely the question is the proper application of the term "salary" as used in that section. The plaintiff contends that at any particular time it is the salary then attached to the rank held for the three years immediately prior to retirement. The defendants contend that it is a fixed amount, the equivalent of the salary actually earned during the three-year period.
 [1a] The plaintiff's basic contention is that the three-year period defines only the rank held and not the salary earned. It finds support in the language of the ordinance itself which refers to the "average salary" as that "attached to the rank or ranks held during the three years." The plaintiff argues that had the framers of the ordinance intended that the pension be fixed by the average salary earned during the three-year period they would have so indicated by describing the "average salary" as that which "was attached to the rank or ranks held during the three years," rather than by using the phrase "the average salary attached" which indicates a presently existing salary. He contends that the framers were aware of such a distinction as evidenced by the language they employed in section 10 to establish a pension ascertainable by reference to a fixed salary independent of salary fluctuations within ranks. That section provides: "Upon the death of any person receiving a pension ... a pension equal to one-third of the average salary upon which said pension ... was based" shall be awarded to certain survivors.
 The plaintiff relies upon Casserly v. City of Oakland (1936), 6 Cal.2d 64 [56 P.2d 237], wherein a provision of the charter of the city of Oakland provided that a pension should be "equal to one half of the salary attached to the rank held" at the date of retirement. The court held that this provision provided for a fluctuating pension, which increased or decreased as the salaries paid to active employees increased or decreased. The language employed in the present case differs from that in the Casserly case only in the addition and substitution of the italicized words in the following quotation of the charter provision in the latter case: "equal to one-half of the average salary attached to the rank or ranks held during the three years immediately preceding the date of retirement." The plaintiff contends that the additional *701 language merely changes the method of determining the "rank" on which pension payments are to be based. While the particular rank in the Casserly case was determined by reference to the rank held at retirement, in the present case it is determined by reference to the rank or ranks held for three years prior to retirement. As the salary of the rank in the Casserly case fluctuated the pensioner's benefits were also held to fluctuate. As the average salary of the rank or ranks held in the present case fluctuates, the plaintiff argues that his benefits should also fluctuate unless the Casserly case is to be disregarded. The court there held at page 66: "the salary attached to the rank at the time the payments fall due, and not the salary at the time the pension was awarded, measures its amount."
 In Klench v. Board of Pension Fund Commrs. (1926), 79 Cal.App. 171 [249 P. 46], a statute provided that a retired police officer was entitled "during his lifetime to a yearly pension equal to one-half of the amount of salary attached to the rank he may have held on such police force on the date of such retirement." The following language from that case is quoted in the Casserly case at pages 66-67: "... it is our belief that the word 'salary' ... was intended to refer to the rank of the retired police officer and not to the time at which he was retired. In other words, the section as phrased seems clearly enough to indicate that what the legislature intended thereby to declare was that, on being retired under said act, a member of the police department should be paid a pension based upon the salary which may be paid to police officers of the rank held by him at the time of the retirement of such officer." (To the same effect, see Whitehead v. Davie, 189 Cal. 715 [209 P. 1008]; Jones v. Cooney, 82 Cal.App. 265 [255 P. 536]; Aitken v. Roche, 48 Cal.App. 753, 755 [192 P. 464]; Rumetsch v. Davie, 47 Cal.App. 512, 514 [190 P. 1075].)
 The defendants contend that the Casserly and other similar cases are not applicable to the facts of the present case because of the difference in the language employed. But they fail to point out a material variation pertinent to the issue here under consideration. True, the provisions of the ordinance might be susceptible to more than one interpretation. [2] But ambiguity and uncertainty in this type of legislation require, under accepted rules, a construction which will, if reasonably possible, accomplish the objects and purposes *702 of the legislation. [3] "It is a general and well recognized rule that pension provisions shall be liberally construed in favor of the applicant." (Gibson v. City of San Diego, 25 Cal.2d 930, 935 [156 P.2d 737]; see, also, Lyons v. Hoover, ante, p. 145 [258 P.2d 4]; McKeag v. Board of Pension Commrs., 21 Cal.2d 386, 390 [132 P.2d 198].)
 To accomplish the result sought by the defendants required an amendment to section 13. This was brought about in 1944, more than four years after the plaintiff retired. The pertinent portions of the section as amended provide for "a pension equal to one-half of the average monthly rate of salary which such member shall have received during the three years immediately preceding the date of retirement. ..." Also in 1944 section 24.1 was added to the ordinance in an endeavor to make section 13 as amended retroactive. The new section provided that "any person now receiving a pension under the terms of this ordinance shall receive an amount based upon the average monthly rate of salary which such member received during the three years immediately preceding the date of retirement, and that said amount shall be a fixed amount that shall not increase nor decrease, regardless of any change in salary subsequent to the date of the granting of the original pension. ..."
 In support of the asserted retroactive effect of section 24.1 the defendants contend that although the right to a pension is a vested right as an integral part of the contract of employment still it is a right to a fair pension only the terms of which may be altered within reason without an impairment of the contract. They rely in the main upon Kern v. City of Long Beach, 29 Cal.2d 848 [179 P.2d 799]. But in that case and in the other cases referred to (Packer v. Board of Retirement, 35 Cal.2d 212 [217 P.2d 660]; Sweesy v. Los Angeles etc. Retirement Board, 17 Cal.2d 356 [110 P.2d 37]; Brophy v. Employees Retirement System, 71 Cal.App.2d 455 [162 P.2d 939]; McCarthy v. Oakland, 60 Cal.App.2d 546, 547 [141 P.2d 4]; Brooks v. Pension Board, 30 Cal.App.2d 118, 119 [85 P.2d 956]) the court did not have before it the question of the obligation due a pensioner after his status had become fixed by the happening of the contingency which made the pension due and payable. [4] The cited cases are authority for the proposition that reasonable changes detrimental to the pensioner may be made in pension provisions for public employees or their beneficiaries before the happening of the contingency. (In this connection see *703 Home v. Souden, 199 Cal. 508 [250 P. 162], concerning changes beneficial to the pensioner made after the happening of the contingency.) [5] In the present case the plaintiff had been retired; he had rendered the called- for performance; he had done everything possible to entitle him to the payment of his pension and all conditions precedent to the obligation of the city were fulfilled upon the determination that he be retired as a result of his service-connected disability. The pension payments are in effect deferred compensation to which the pensioner becomes entitled upon the fulfillment of the terms of the contract which may not be changed to his detriment by subsequent amendment. (Robertson v. Miller, 276 U.S. 174 [48 S.Ct. 266, 72 L.Ed. 517]; Kern v. City of Long Beach, supra, 29 Cal.2d 848; Kavanagh v. Board of Police P. F. Commrs., 134 Cal. 50 [66 P. 36]; Vero v. Sacramento City E. R. System, 41 Cal.App.2d 482 [107 P.2d 82]; 20 Cal.Jur. 998.)
 [1b] Accordingly it is concluded that the provisions of section 13 in effect when the plaintiff retired were in all material respects the same as the language of the charter provisions of the city of Oakland involved in the Casserly case, insofar as those provisions relate to the present inquiry; and that the amended section did not affect the plaintiff's retirement benefits.
 The judgment is affirmed.
 Carter, J., Traynor, J., Schauer, J., and Spence, J., concurred.
 Gibson, C.J., and Edmonds, J., concurred in the judgment.
