OPINION OF THE COURT
Jones, J.A plaintiff who has commenced a matrimonial action prior to the effective date of the “Equitable Distribution Law” may not discontinue that action for the purpose of instituting a second action after that date in order to obtain benefits under the broader provisions relating to distribution of marital property applicable in actions commenced after the statute became effective.
On December 12, 1978 plaintiff wife commenced the present action for divorce; after the pleadings had been served, in April, 1980 the case was assigned a trial date which was later adjourned. On July 3,1980, approximately two weeks before the effective date of the amendment to section 236 of the Domestic Relations Law incorporating what has come to be known as the “Equitable Distribution Law,”1 the husband began a separate action for divorce. On August 5, 1980, after the effective date of the statute, the wife moved to discontinue her action for the announced purpose of instituting a second divorce action in which, because of its having been commenced after July 19,1980, *383she might obtain the benefits of the expanded property distribution provisions contained in part B of section 236. In the alternative she requested leave to amend her complaint in the pending action to include in the relief sought equitable distribution of the marital property of the parties in accordance with the provisions of part B. The husband opposed his wife’s application and also moved for leave to amend his answer to set up counterclaims for divorce.
Supreme Court granted the wife’s motion to discontinue her pending action with the statement that “In the interest of public policy the Court will not direct that an action for divorce be continued against the wishes of the plaintiff”, and denied the husband’s cross motion. The Appellate Division unanimously reversed on the law and denied the wife’s motion in its entirety; the husband’s cross motion to amend his answer was granted “upon condition that he stipulates that plaintiff’s rights will not be affected if she is found guilty of misconduct, and upon any other conditions which Special Term deems just” with a reference to CPLR 3025 (subd [b]). The case is before us on cross appeals. The wife contends that the Appellate Division erred in holding, as a matter of law, that Supreme Court could not exercise its discretion to grant her application to discontinue the action she began before the Equitable Distribution Law became effective; the husband challenges the lower court’s authority to condition amendment of his answer on the stipulation described above.
We consider first the Appellate Division’s ruling with respect to the wife’s motion.
While the authority of a court to grant or to deny an application made to it pursuant to CPLR 3217 (subd [b]) by a party seeking voluntarily to discontinue litigation is within its sound discretion, ordinarily a party cannot be compelled to litigate and, absent special circumstances, discontinuance should be granted (4 Weinstein-Korn-Miller, NY Civ Prac, par 3217.06). Particular prejudice to the defendant or other improper consequences flowing from discontinuance may however make denial of discontinu*384anee permissible or, as the Appellate Division correctly held in this case, obligatory.
There is no question as to the purpose for which this plaintiff sought to abandon her action instituted in December, 1978; with commendable candor she stated in her supporting affidavit that she sought discontinuance of her pending action in order that she might commence a new action, also seeking dissolution of her marriage, in which, by virtue of the action’s having been commenced after the effective date of the Equitable Distribution Law, she could assert a demand for the more liberal property distribution provided by part B of section 236 of the Domestic Relations Law. Otherwise stated, she sought to avoid restriction to the economic powers conferred by part A of the statute on the court which would hear her pre-July, 1980 divorce action and, by jettisoning her pending action and resurrecting its predicate in a second action, thereby to evade the legislative mandate that the rights and obligations of the parties in actions commenced prior to the effective date of the statutory amendment shall be determined in accordance with the provisions of part A. Prevention of such intentional frustration of the considered decision by the Legislature as to which actions are to be governed by the two, quite different, constituent parts of the statute (cf. Valladares v Valladares, 55 NY2d 388, decided herewith) is an objective which mandates denial as a matter of law of the discontinuance requested in the present case.2 The Legislature fixed a categorical line of demarcation; in actions commenced prior to July 19, 1980 the substantive provisions of part A of new section 236 will apply; in actions commenced on or after that date the substantive provisions of part B apply. And in assigning individual cases to the one category or the other the phrase “an action commenced” refers to the commonly understood initial *385institution of the action whereby the court first obtains jurisdiction of both husband and wife.
Further pragmatic justification for the categorical distinction drawn by the Legislature and implemented by the Appellate Division and now confirmed by this court in the present case lies in the fact that it will preclude variegated treatment of plaintiffs who, having commenced matrimonial actions before July 19,1980, thereafter seek to discontinue and then to recommence and might otherwise receive disparate treatment at the hands of Judges who exercise even a reasonable discretion in ruling on their applications. In view of the clear intent expressed in the statute as to the applicability of parts A and B, there is no room for the exercise of judicial discretion to vary what has been prescribed by the Legislature.
Concluding, as we do, that the Appellate Division’s reversal of the. order granting plaintiff’s motion to discontinue should be affirmed, we turn to consideration of the husband’s appeal taken from so much of the order of the court below as conditioned the grant of his application to amend his answer to plead counterclaims for divorce on a stipulation by him that plaintiff wife’s rights would not be affected if she should be found guilty of misconduct.
Because the condition of which the husband complains was improperly imposed, the order must be modified in this regard. The statutory provision authorizing amendment of pleadings reflects a liberal attitude in its direction that leave to amend “shall be freely given” (CPLR 3025, subd [b]). Permission to amend is to be restricted only by the imposition of “such terms as may be just”. The portion of the opinion of the Appellate Division in which it addressed its disposition of the husband’s motion to amend his answer fails to disclose any proper justification for the condition imposed and indeed reveals that the objective sought to be accomplished runs counter to what the Legislature provided when it amended section 236 of the Domestic Relations Law. The court first recognized that the wife’s continuing pre-July, 1980 action would be governed by the provisions of part A of the statute and that under that part *386her right to alimony would be cut off if the husband established her misconduct by proof offered in support of his counterclaims for divorce based on cruel and inhuman conduct and on abandonment. The condition, by which the husband would be required to stipulate that the wife’s rights would not be affected by a finding of misconduct, was then imposed for the purpose of “averting any prejudicé to [the Wife]”.
What was perceived as prejudice, however, was simply the operation of the statutory provisions which, in denying her motion to discontinue, the court had properly held were applicable to the determination of the rights and obligations of the parties in her action for divorce begun before July 19,1980. As the wife herself acknowledges — again to her credit — the effect of the condition was to disregard both the mandate of the statute and the existence of the husband’s own independent action for divorce instituted on July 3, 1980 in which proof of the wife’s misconduct would bar her recovery of an award of alimony.
The Appellate Division was not at liberty, in granting the husband’s application to interpose counterclaims for divorce in his wife’s part A action, to require his consent to a variation of the substantive provisions which by legislative fiat are applicable to that action. As we have indicated, the Legislature determined that in all actions commenced prior to July 19, 1980 the provisions of part A apply. The condition attached by the Appellate Division would be incompatible with that determination. The order should therefore be modified to delete the condition imposed on the grant of the husband’s motion to amend his answer.3
*387In disposing of these cross appeals we do not reach the argument tendered by the husband that the equitable distribution provisions of part B of section 236 of the Domestic Relations Law as applied to him are violative of his constitutional rights to due process and equal protection and unconstitutionally impair contract obligations. Inasmuch as we have determined that his wife’s application to discontinue her prestatutory-amendment action was properly denied in consequence of which she is precluded from receiving benefits under part B, the husband is not aggrieved by the enactment of the segment of the statute that incorporates the equitable distribution provisions; it will have no application to the determination of his obligations or rights. He therefore lacks standing to challenge that portion of section 236 of the Domestic Relations Law.
For the reasons stated, the order appealed from should be modified to delete the condition attached to the grant of the husband’s motion to amend his answer, and, as so modified, should be affirmed, with costs to the husband.
Chief Judge Cooke and Judges Jasen, Gabrielli, Wachtler, Fuchsberg and Meyer concur.
Order modified, with costs to defendant, in accordance with the opinion herein and, as so modified, affirmed. Question certified answered in the negative.
. The new section 236 was accomplished by section 9 of chapter 281 of the Laws of 1980, which carried an effective date of July 19,1980. The substantive provisions of the section are set out in two parts. Part A, which provides for alimony and financial disclosure, is essentially similar to prior section 236, except that it is gender-neutral. Part B incorporates new equitable distribution provisions for property held during marriage. As to applicability of the parts, the first sentence in the amendment provides: “Except as otherwise expressly provided in this section, the provisions of part A shall be controlling with respect to any action or proceeding commenced prior to the date on which the provisions of this section as amended become effective and the provisions of part B shall be controlling with respect to any action or proceeding commenced on or after such effective date.” In a similar vein, subdivision 2 of part B provides in part: “Except as provided in subdivision five of this part [not affecting application as to time], the provisions of this part shall be applicable to actions for an annulment or dissolution of a marriage,' for a divorce, for a separation, for a declaration of the nullity of a void marriage, for a declaration of the validity or nullity of a foreign judgment of divorce, for a declaration of the validity or nullity of a marriage, and to proceedings to obtain maintenance or a distribution of marital property following a foreign judgment of divorce, commenced on and after the effective date of this part.”
. It may be inquired what the rule should be in an instance in which the plaintiff is less open in disclosing the objective behind his or her motion to discontinue, or even affirmatively masks its ulterior purpose. In such a case the court might assure accomplishment of the legislative intent by exercising its statutory authority to impose appropriate terms and conditions on a discontinuance (CPLR 3217, subd [b]), as for example, by granting the application to discontinue with prejudice to institution of a subsequent matrimonial action based on any conduct which might have been the basis for an action prior to July 19, 1980.
. Inasmuch as the only grounds advanced by the wife or considered by the Appellate Division in opposition to the husband’s motion to amend relate to the application of new section 236 (and we hold that the specificity of the legislative enactment forecloses the exercise of any judicial discretion in that regard) and in view of the statutory prescription that leave to amend “shall be freely given” (CPLR 3025, subd [b]), we conclude that to deny the husband’s motion would be error as a matter of law. Accordingly, we see no useful purpose to be served in this instance in remitting the case to the Appellate Division (as we would otherwise be disposed to do) to permit that court to reconsider *387disposition of the husband’s motion, deprived of its power to attach the impermissible condition.