Casey, J. Appeal (transferred to this court by order of the Appellate Division, Second Department) from an order of the Supreme Court (Stolarik, J.), entered May 24, 1989 in Rockland County, which denied plaintiff’s motion for payment of maintenance arrears and counsel fees.
At issue on this appeal is whether plaintiff is entitled, following her remarriage, to maintenance from her former husband pursuant to the terms of a comprehensive separation agreement, which was incorporated into but survived the judgment of divorce, where the agreement specifies that payments shall continue until the death of either of the parties or until five years from the signing of the agreement, whichever occurs earlier. Supreme Court held that plaintiffs remarriage terminated the maintenance provision of the separation agreement. We disagree.
After the parties separated due to marital problems, they entered into a stipulation of settlement in February 1987 which was intended to be "in full satisfaction of all rights acquired either on or before the enactment of the equitable distribution statute in the State of New York”. Among the many items covered by the agreement was defendant’s payment of maintenance to plaintiff. Pursuant to the article covering this item, defendant was required to make monthly payments of $200 "until the earliest happening of one of the following events: (1) The death of either of the parties hereto; (ii) Five years from the date of the signing of this Agreement”. The parties intended the agreement to be an "opting out” agreement and it was executed in accordance with the requirements of Domestic Relations Law § 236 (B) (3). Consequently, the terms of the agreement were included in the judgment of divorce, but the judgment expressly provided that the agreement survived and did not merge in the judgment.
*734When plaintiff remarried in May 1988, defendant stopped paying maintenance, and plaintiff thereafter sought to compel defendant’s compliance with the maintenance provision described above. Supreme Court concluded that in the absence of any provision for the continuation of maintenance after plaintiff’s remarriage, the obligation terminated. Plaintiff appeals from the order denying her application.
It has been said that as a matter of public policy, a spouse who has remarried cannot compel support from a former spouse (see, e.g., Jacobs v Patterson, 112 AD2d 402, 403). This policy is embodied in Domestic Relations Law § 236 (B) (6) (c), which provides that "an award of maintenance shall terminate upon the death of either party or upon the recipient’s valid or invalid marriage”. Domestic Relations Law § 236 (B) (3) provides, however, that an opting out agreement can include a "provision for the amount and duration of maintenance”, and the maintenance provisions of Domestic Relations Law § 236 (B) (6) are expressly made inapplicable to opting out agreements (Domestic Relations Law § 236 [B] [6] [a]). Thus, an agreement requiring that maintenance shall continue after remarriage is not against public policy and is enforceable (Fredeen v Fredeen, 154 AD2d 908). In Fredeen v Fredeen (supra), the Fourth Department found that "the agreement clearly evinces the intent of the parties that defendant’s maintenance obligation would continue * * * unconditioned on plaintiff’s marital status” (supra, at 908). In Jacobs v Patterson (supra, at 403), the Second Department found that "the agreement was silent concerning the effect of remarriage upon defendant’s support obligations, and as nothing in the agreement in any way implies that the obligation is to continue, no such obligation should be assumed”.
The issue is clearly dependent upon the facts of the particular case, but in reviewing those facts we are guided by the principles set forth in Cohen v Cronin (39 NY2d 42), which considered the question of whether a provision in a separation agreement obligating the husband to make support payments to his wife survived his death and was binding upon his estate. In resolving this issue the Court of Appeals explained:
"We start with the well-accepted proposition that a husband’s obligation to support his wife terminates with the husband’s death. However, the husband might, by agreement, impose upon his estate a duty to make alimony or support payments after his death * * *. In order to bind the estate, a separation agreement must either specifically provide for the continuation of payments or evince, from the terms of the *735agreement read as a whole, a clear intention that support payments continue, notwithstanding the husband’s death * * * While explicit agreement by the parties is obviously much to be preferred, where such explicit agreement is lacking, the court must read the document as a whole in its total context and examine each of its provisions in order to ascertain the overriding intention of the parties * * *.
"From our analysis of the agreement, we conclude that the provision in the agreement for the support payments to the wife to continue 'until she shall remarry or expire’, without any qualifying or limiting language, obligates the husband’s estate to make the payments for the lifetime of the wife [or until she remarries]” (supra, at 45-46).
Here, the agreement obligates defendant to pay maintenance for five years unless either party dies before the expiration of the five-year period. There is no other qualifying language and there is nothing in the agreement to suggest that any of the parties’ rights or obligations are dependent upon the absence of a remarriage. The agreement is comprehensive and was intended to embody all of the parties’ rights and obligations to each other. During the negotiation and execution of the agreement, the parties were represented by counsel, and the agreement expressly recognizes that the parties were securing certain rights and waiving others. Accordingly, we have little difficulty in concluding that, in addition to the qualification based upon the death of either party, defendant obtained a five-year time limit on his maintenance obligation in return for a waiver of his right to insist on termination in the event of plaintiff’s remarriage. It is also noteworthy that the agreement specifically provides that "[regardless of whatever income [plaintiff] may now or hereafter have, or the source thereof, or whether earned or unearned, the same shall in no way affect or limit the obligation of [defendant] to provide for her support”. Based upon our reading of the clear and unambiguous language of the agreement as a whole, we conclude that the duration of defendant’s maintenance obligation is limited only by the qualifying events specified in the agreement and that, therefore, plaintiff’s remarriage did not terminate defendant’s obligation.
The matter must therefore be remitted to Supreme Court for a determination of the amount of maintenance due and owing to plaintiff and for a resolution of the counsel fees issue raised in the application.
Order reversed, on the law, with costs, motion granted to the extent of declaring that plaintiff’s remarriage did not *736terminate defendant’s maintenance obligation under the parties’ agreement and matter remitted to Supreme Court for further proceedings not inconsistent with this court’s decision. Mahoney, P. J., Casey, Mikoll, Yesawich, Jr., and Harvey, JJ., concur.