
264 S.E.2d 406 (1980)
46 N.C. App. 1
Ernest Moses LAYELL
v.
Patricia Huston BAKER.
No. 7923SC778.
Court of Appeals of North Carolina.
April 1, 1980.
*408 Franklin Smith, Elkin and Womble, Carlyle, Sandridge & Rice by James M. Stanley, Jr., Winston-Salem, for plaintiff-appellee.
Hutchins, Tyndall, Bell, Davis & Pitt by William K. Davis, Winston-Salem, for defendant-appellant.
PARKER, Judge.
The parties agree that the validity of the court's order denying defendant's motion in abatement in Case No. 79CVS97 is dependent upon the validity of the court's ruling dismissing defendant's counterclaim in Case No. 77CVS27. If the court was correct in dismissing defendant's counterclaim *409 in the earlier case, then there was no prior action pending and defendant's plea in abatement in the later case fails. On the other hand, if the court was in error in dismissing defendant's counterclaim in the earlier case, then there was a prior action pending between the same parties involving the same cause of action and defendant's plea in abatement in the later action should have been sustained. Decisions of our Supreme Court have uniformly held that "the pendency of a prior action between the same parties for the same cause of action in a State court of competent jurisdiction works an abatement of a subsequent action either in the same court or in another court of the State having jurisdiction." Sales Co. v. Seymour, 255 N.C. 714, 715, 122 S.E.2d 605, 606 (1961); accord, Conner Co. v. Quenby Corp., 272 N.C. 214, 158 S.E.2d 22 (1967). Thus, the question presented by this appeal is whether the court was correct in its ruling dismissing defendant's counterclaim in Case No. 77CVS27. We hold that the court was in error, and accordingly reverse.
G.S. 1A-1, Rule 41 provides in part:
(a) Voluntary dismissal; effect thereof.
(1) By Plaintiff; by Stipulation.Subject to the provisions of Rule 23(c) and of any statute of this State, an action or any claim therein may be dismissed by the plaintiff without order of court (i) by filing a notice of dismissal at any time before the plaintiff rests his case ....
Prior to the adoption of Rule 41, effective 1 January 1970, it was settled practice that the plaintiff might take a voluntary nonsuit as a matter of right at any time before the verdict. However, as the former practice was explained by McIntosh in North Carolina Practice and Procedure, § 1645, pp. 124-125 (1956):
While the plaintiff may generally elect to enter a nonsuit, "to pay the costs and walk out of court," in any case in which only his cause of action is to be determined, although it might be an advantage to the defendant to have the action proceed and have the controversy finally settled, he is not allowed to do so when the defendant has set up some ground for affirmative relief or some right or advantage of the defendant has supervened, which he has the right to have settled and concluded in the action. If the defendant sets up a counterclaim arising out of the same transaction alleged in the plaintiff's complaint, the plaintiff cannot take a nonsuit without the consent of the defendant; but if it is an independent counterclaim, the plaintiff may elect to be nonsuited and allow the defendant to proceed with his claim. (emphasis added.)
Thus, under prior law, where the defendant interposed a claim for affirmative relief, the plaintiff's right to a voluntary nonsuit was thereby affected, and the precise effect upon that right depended upon whether the defendant's claim arose out of the same transaction alleged in the plaintiff's complaint or was distinct from that alleged. Bynum v. Powe, 97 N.C. 374, 2 S.E. 170 (1887); Whedbee v. Leggett, 92 N.C. 469 (1885). If the defendant's claim for relief arose out of the same transaction, then the plaintiff's right to take a voluntary nonsuit was completely denied, whereas if the claim for relief was independent of the plaintiff's claim, the plaintiff could submit to a voluntary nonsuit as to his claim, but the defendant was entitled, if he desired, to keep the action before the court until his own claim was litigated. Yellowday v. Perkinson, 167 N.C. 144, 83 S.E. 341 (1914); Whedbee v. Leggett, supra. In McCarley v. McCarley, 289 N.C. 109, 221 S.E.2d 490 (1976), our Supreme Court held that the adoption of G.S. 1A-1, Rule 41(a)(1) altered prior practice only to the extent that the plaintiff desiring to take a voluntary dismissal must now act before he rests his case rather than before the trial court renders the verdict, but that in other respects, prior practice continues in effect.
In the present case it is unquestioned that defendant's claim for affirmative *410 relief arose out of the same transaction, the automobile collision, alleged in plaintiff's complaint. Applying the rules of practice still in effect in this State as modified by Rule 41, we conclude that defendant's assertion of that counterclaim, nothing else appearing, could effectively deprive plaintiff not only of his ability to escape defendant's claim against him, but also of his right under Rule 41 to dismiss his own claim. The rule precluding voluntary dismissal in a case such as is here presented is premised on the theory that the "plaintiff cannot justly complain if he is detained in court until the whole merits of his cause of action are tried, and the rights of the defendant growing out of the same are settled, if the latter shall so desire." Yellowday v. Perkinson, supra at 183, 83 S.E. at 342 (emphasis added). We reject plaintiff's contention that defendant's failure, prior to the court's discharging the jury, to bring to the court's attention the pendency of her counterclaim amounted to an implied consent to the dismissal. The question remains, however, whether defendant's written "consent" to the voluntary dismissal of plaintiff's claim, which was expressly made "without prejudice to defendant's prosecution of her claim" restored to plaintiff his right to dismiss his own claim under Rule 41(a)(1) or deprived defendant of her right to pursue her counterclaim.
In McCarley v. McCarley, supra at 113, 221 S.E.2d at 493, our Supreme Court recognized that the defendant might consent to the withdrawal of plaintiff's allegations. The Court did not hold, as contended in plaintiff's brief, that "a defendant who has asserted a compulsory counterclaim cannot permit plaintiff to dismiss the complaint and proceed with his counterclaim," and that only when there is a permissive counterclaim can defendant "elect to proceed with his counterclaim" after consenting to plaintiff's dismissal. Although Rule 41(a) contemplates that civil litigation may be terminated as to all parties, both plaintiff and defendant, and as to all claims and counterclaims, upon the consent of all the parties, no such broad consent has been shown in the present case. Defendant's written "consent" to the voluntary dismissal of plaintiff's claim was expressly given "without prejudice to defendant's prosecution of her claim." Thus, at most, that consent removed the barrier which defendant's counterclaim otherwise presented to plaintiff's right under Rule 41(a)(1) to dismiss his own claim. It did not effect a dismissal of defendant's counterclaim nor did it permit plaintiff simply to walk away from the litigation which he had himself begun. The court's initial ruling, when it found that it had by inadvertence discharged the jury, of declaring a mistrial of the counterclaim and setting the case for trial on the counterclaim at the next session of court, was correct. The court erred when it later reversed that ruling and dismissed the counterclaim.
Upon remand, defendant's answer alleging her claim in Case No. 77CVS27 will in effect become a complaint. Although plaintiff chose to dismiss his own claim for relief in the earlier proceedings on the assumption that the entire litigation would be ended, he should, if he so elects, be permitted to amend his pleadings in the action so as to assert his claim as a compulsory counterclaim to the claim of the defendant.
The result is that the orders appealed from both in Case No. 77CVS27 and in Case No. 79CVS97 are reversed. Defendant's motion in abatement in Case No. 79CVS97 should be allowed and judgment entered in that case dismissing it because of the prior action pending. The order dismissing Case No. 77CVS27 is vacated, and that case is remanded for trial upon the claim asserted in defendant's counterclaim and upon such response thereto as plaintiff may allege.
Reversed and remanded.
HARRY C. MARTIN and HILL, JJ., concur.
