I dissent. The parties were aware that the case of McCarty v. McCarty (1981) 453 U.S. 210 [69 L.Ed.2d 589, 101 S.Ct. 2728] would soon be decided by the U.S. Supreme Court. Referring expressly to that case, they stipulated that if the Supreme Court ruled military retirement pay was not divisible as community property, wife would receive no community interest in husband’s military retirement benefits. The Supreme Court ruled in McCarty that military retirement pay was the separate property of the military spouse (453 U.S. at pp. 232-236 [69 L.Ed.2d at pp. 605-608]). Judgment of dissolution was entered incorporating the stipulation. That judgment has long since become final.
The majority holds that Civil Code section 5124 may be retroactively applied fundamentally to modify that final judgment to the wife’s advantage and the husband’s substantial detriment. In my view section 5124, as applied here, unconstitutionally impairs the obligation of contract and deprives husband of vested property rights without due process of law.
Congress responded to the McCarty decision by enacting Senate Bill No. 1814, which became the Federal Uniformed Services Former Spouses’ Protection Act (FUSFSPA). (10U.S.C. § 1408.) Effective February 1,1983, FUSFSPA nullifies the preemptive effect of the federal statutes interpreted in the McCarty decision, allowing state courts to treat military retirement benefits either as separate or community property in accordance with the law of the particular jurisdiction. (10 U.S.C. § 1408(c)(1).) Although FUSFSPA in terms applies retroactively to June 26, 1981, the date McCarty was decided (1982 U.S. Code Cong. & Admin. News, at pp. 1599-1600; In re Marriage ofAnkenman (1983) 142 Cal.App.3d 833, 837 [191 Cal.Rptr. 292]; In re Marriage of Buikema (1983) 139 Cal.App.3d 689, 691 [188 Cal.Rptr. 856]), it has been held applicable only to those cases not yet final as of its effective date, February 1, 1983. (In re Marriage of Hopkins (1983) 142 Cal.App.3d 350, 360 [191 Cal.Rptr. 70]; In re Marriage of Fairfull (1984) 161 Cal.App.3d 532, 535 [207 Cal.Rptr. 523]; Mueller v. Walker (1985) 167 Cal.App.3d 600, 605 [213 Cal.Rptr. 442].) Thus, so far as FUSFSPA is concerned, McCarty remains a viable rule of decision as to those judgments which became final during the 19-month interval between its announcement and the effective date of FUSFSPA. (Mueller, supra, 167 Cal.App.3d at p. 606.)
To bridge this gap the Legislature enacted Civil Code section 5124,1 which allows community property settlements, judgments or decrees that *527became final on or after June 25, 1981, and before February 1, 1983, to be modified to include a division of military retirement benefits payable on or after February 1, 1983, as community property. (Stats. 1983, ch. 775, § 1, eff. Jan. 1, 1984, through Jan. 1, 1986.) Section 5124 operates to reopen judgments which became final after McCarty and prior to FUSFSPA’s effective date in order to extend the ameliorative benefits of the federal statute.
I
Husband contends the application of section 5124 to this case unconstitutionally impairs the obligation of contract. A husband and wife may divide their property as they choose pursuant to a property settlement agreement, regardless of how the law otherwise would characterize and divide the property. These agreements are favored by law. (§§ 5103, subd. (a); 4800, subd. (a); Adams v. Adams (1947) 29 Cal.2d 621, 624 [177 P.2d 265]; Dexter v. Dexter (1954) 42 Cal.2d 36, 40 [265 P.2d 873].) In the absence of fraud or compulsion, such agreements are valid and binding on the court and cannot be modified without the consent of the parties. (Adams, supra, at pp. 624-625.)
There is no evidence of fraud or compulsion here. The parties entered into a stipulated judgment which was placed on the record in open court. The stipulation apparently allocated all the property of the parties, consisting of automobiles, bank accounts, insurance policies, household furnishings, other personal property and real estate. Included in the latter category was the family residence which was allocated to wife on condition only that she “give the respondent [husband] $8,000 of the sale proceeds when it is sold,” there being “no time frame for when it is to be sold.” No values were ascribed to the various assets and it cannot be determined whether the division was equal. As an integral part of the agreement, the parties agreed to hazard the retirement benefits on the outcome of McCarty.
By entering into such a property settlement agreement, a contract arose. Although wife did not expressly renounce all rights in the retirement pay, she and husband each undertook to abide by the outcome of McCarty with respect to its allocation. The parties are entitled to expect that their contract will be performed, and each is bound to its terms based on these settled expectations. (Cf. Sharpe v. Superior Court (1983) 143 Cal.App.3d 469, 472 [192 Cal.Rptr. 16]; In re Marriage of Mahone (1981) 123 Cal.App.3d 17, 21-22 [176 Cal.Rptr. 274]; In re Marriage of Sheldon (1981) 124 Cal.App.3d 371, 383-384 [177 Cal.Rptr. 380].)
The United States and California Constitutions each prohibit laws which impair the obligation of contract. (U.S. Const., art. I, § 10, cl. 1; Cal. *528Const., art. I, § 9.) However, the constitutional contract clauses are not absolute; they must be accommodated to the police power of the state “to safeguard the vital interests of its people.” (Home Building & Loan Asso. v. Blaisdell (1934) 290 U.S. 398, 434-435 [78 L.Ed.413, 426-427, 54 S.Ct. 231, 88 A.L.R. 1481]; see also Valdes v. Cory (1983) 139 Cal.App.3d 773, 789 [189 Cal.Rptr. 212].)
The United States Supreme Court follows a three-step analysis of contract impairment claims. First, the state law must operate “as a substantial impairment of a contractual relationship.” Second, if there is a substantial impairment, “the State, in justification, must have a significant and legitimate public purpose behind the regulation.” Third, if a legitimate public purpose exists, the adjustment of rights and responsibilities of the contracting parties must be based upon “reasonable conditions” and “of a character appropriate to the public purpose justifying [the legislation’s] adoption. [Citations.]” (Energy Reserves Group v. Kansas Power & Light (1983) 459 U.S. 400, 411-413 [74 L.Ed.2d 569, 580-581, 103 S.Ct. 697]; see also Rue-Ell Enterprises, Inc. v. City of Berkeley (1983) 147 Cal. App.3d 81, 87-89 [194 Cal.Rptr. 919]; Interstate Marina Development Co. v. County of Los Angeles (1984) 155 Cal.App.3d 435, 445-446 [202 Cal.Rptr. 377].)
Here the modification permitted by section 5124 effectively eviscerated the agreement. The parties agreed husband’s military retirement pay would be his sole property if the McCarty decision ruled on that issue in favor of military retirees. The condition precedent to husband’s realization of his rights under the contract had long since occurred when wife moved to modify the judgment. The modification deprives husband of substantial benefits for which he bargained without relieving him of any of the obligations; at the same time it permits wife to repudiate a material obligation of the contract while retaining all the benefits. The modification, without consent of husband, inevitably frustrated his settled expectations. It is beyond dispute that the impairment is substantial.
Since there is substantial impairment the inquiry focuses on whether there is adequate justification in the nature of a significant and legitimate public purpose which is furthered by the application of section 5124 to these circumstances. The asserted justification for the impairment is the state interest in effectuating the legislative intent of FUSFSPA, thus eliminating the hardships suffered by a class of persons whose property settlement agreements, by chance, became final during the period between McCarty and FUSFSPA. (Leg. Counsel’s Dig. of Sen. Bill No. 1034 (1983-1984 Reg. Sess.); Mueller v. Walker, supra, 167 Cal.App.3d at p. 609.) Uniform application of FUSFSPA would thus insure equal treatment for those individuals whose cases fortuitously were resolved during the reign of McCarty. *529This state interest in the equitable distribution of marital property is significant and legitimate (see Mueller, supra, 167 Cal.App.3d at p. 609) and in some cases may well justify the reopening of final judgments as an appropriate means to advance this public purpose.
In this case, however, there is no state interest which would justify a substantial impairment of contract. Wife does not fall within the class of persons who by chance suffered inequities by virtue of McCarty. First, as part of an overall property settlement she agreed to wait until McCarty was decided before a determination was made of the status of husband’s retirement benefits; second, she agreed that the outcome of McCarty would control that determination. Because these choices were freely made in the context of mutual undertakings, no inequities or hardships have fortuitously been inflicted upon wife which would justify state interference with the contract. To the contrary, the settled and strong expectations of the parties contemplated that on the happening of the condition precedent in a certain way, husband would receive the sole right to the retirement benefits. Because of the lack of any justifiable state interest in interfering with the performance of this agreement, the application of section 5124 here is an unconstitutional impairment of contract.
II
Husband contends the retroactive application of section 5124 here results in an unconstitutional deprivation of vested rights without due process of law.
Husband’s right to sole ownership of his retirement benefits became vested when, after the McCarty decision, the stipulated judgment became final. At that point the right to the retirement benefits was no longer subject to a condition precedent. (See In re Marriage of Bouquet (1976) 16 Cal.3d 583, 591, fn. 7 [128 Cal.Rptr. 427, 546 P.2d 1371].)
However, vested rights, like contract rights, are not absolutely inviolable at the hands of the state. A state in the exercise of its police power may impair such rights ‘“whenever reasonably necessary to the protection of the health, safety, morals, and general well being of the people. . . . [1Í] The constitutional question, on principle, therefore, would seem to be, not whether a vested right is impaired by a marital property law change, but whether such a change reasonably could be believed to be sufficiently necessary to the public welfare to justify the impairment.’” (Addison v. Addison (1965) 62 Cal.2d 558, 566 [43 Cal.Rptr. 97, 399 P.2d 897, 14 A.L.R.3d 391], quoting Armstrong, “Prospective” Application of Changes in Community Property Control—Rule of Property or Constitutional Ne*530cessity? (1945) 33 Cal.L.Rev. 476, 495; see also Bouquet, supra, 16 Cal.3d at p. 592.)
“In determining whether a retroactive law contravenes the due process clause, we consider such factors as the significance of the state interest served by the law, the importance of the retroactive application of the law to the effectuation of that interest, the extent of reliance upon the former law, the legitimacy of that reliance, the extent of actions taken on the basis of that reliance, and the extent to which the retroactive application of the new law would disrupt those actions.” (Bouquet, supra, 16 Cal.3d at p. 592; see also In re Marriage of Buol (1985) 39 Cal.3d 751, 761 [218 Cal.Rptr. 31, 705 P.2d 354].) Where retroactive application is necessary to serve a sufficiently important state interest, the inquiry need go no further. (Buol, supra, 39 Cal.3d at p. 761.) The state’s interest in the equitable dissolution of the marital relationship has been held to be sufficiently important to justify retroactive legislation to “remedy ‘the rank injustice of the former law’” (Boul, supra, 39 Cal.3d atp. 761, quoting Bouquet, supra, 16 Cal.3d at p. 594, and Addison, supra, 62 Cal.2d at p. 567), and to abrogate rights in marital property that derived from patently unfair former law. (Bouquet, supra, 16 Cal.3d at p. 594.) Thus, application of section 5124 to modify a final judgment may be justified when the parties by happenstance fall within the McCarty interregnum, subjecting one of them to the “rank injustice” of deprivation of marital property rights from the “patently unfair former law” announced in McCarty.
As already indicated, retroactive application of section 5124 in these circumstances does not advance any legitimate state interest. Wife is not the victim of rank injustice, nor is the judgment the product of an unfair law. Wife’s rights under the judgment arise not from the law but from her agreement, freely entered, to accept the decision in McCarty, whatever it may be, as the final determinant of her rights in husband’s military retirement pay. Wife was not forced to accept the ultimate outcome in McCarty as controlling law; rather she agreed to do so as part of an overall settlement of property rights.
The majority deems significant the degree of reliance placed on the vested right, concluding husband was not entitled to any long-settled expectation that his pension would be his separate property because prior to McCarty pension rights were community assets in California and Congress enacted FUSFSPA only 19 months after McCarty. This conclusion miscontrues the nature and extent of husband’s reliance. His expectations derived from the marital property settlement agreement, not from pre-McCarty law. Husband ordered his affairs in reliance on the judgment for two and one-half years. *531In view of the constitutional protection accorded contractual obligations and vested property rights, his reliance was reasonable.
The majority characterizes husband’s stake as an interest in vested rights derived from principles governing finality of judgments and res judicata. The state interest of course is in effecting an equitable division of marital property as to those who would otherwise fortuitously be divested by McCarty. The majority concludes the state interest is sufficiently important to justify nullification of the res judicata effect of the judgment here. For reasons already stated, the state interest in the application of section 5124 is irrelevant to these facts and thus cannot outweigh husband’s interest in the finality of judgments. “[Fjinality in dissolution proceedings is extremely important from the standpoint of the human beings involved. . ,. .” and the interests of the parties or society are not served by disrupting settled expectations. (In re Marriage of Sheldon, supra, 124 Cal.App.3d at p. 383.) Res judicata is designed to put “. . .an end to litigation and even erroneous final judgments must be honored in order to continue the ‘well-ordered functioning of the judicial process.’” (In re Marriage of Fellers (1981) 125 Cal.App.3d 254,257 [178 Cal.Rptr. 35], quoting Slater v. Blackwood (1915) 15 Cal.3d 791,797 [126 Cal.Rptr. 225, 543 P.2d 593].) Although legislation may modify res judicata rules when based on a reasonable public policy or other rational basis (Mueller, supra, 167 Cal.App.3d at p. 607; see also Deas v. Knapp (1981) 29 Cal.3d 69, 79 [171 Cal.Rptr. 823, 623 P.2d 775]), the absence of a reasonable public policy rationale here precludes the application of section 5124 to avoid the res judicata effect of the judgment.
Retroactive application of section 5124 here unconstitutionally impairs the obligation of contract and deprives husband of vested rights without due process of law. I would reverse the order of modification.
A petition for a rehearing was denied June 17, 1986. Puglia, P. J., was of the opinion that the petition should be granted.
All references hereinafter to sections of an unspecified code are to the Civil Code.