
320 Md. 223 (1990)
577 A.2d 51
DOROTHY C. ROWLAND
v.
MICHAEL J. HARRISON.
No. 25, September Term, 1989.
Court of Appeals of Maryland.
August 1, 1990.
C. Stephen Basinger, Baltimore and Jacqueline R. Vaughn, Upperco, on brief, for appellant.
T. Rogers Harrison, William P. Harrison, Mudd, Harrison & Burch, Towson, on brief, for appellee.
Argued before MURPHY, C.J., and ELDRIDGE, COLE, RODOWSKY, McAULIFFE, ADKINS and BLACKWELL[*], JJ.
MURPHY, Chief Judge.
This case involves a suit by Dorothy Rowland, the owner of a now-deceased thoroughbred horse named Kluwall, against Dr. Michael Harrison for veterinary malpractice in the care and treatment of Kluwall between June 8 and 27, 1986. The question presented is whether the malpractice action is barred on principles of res judicata because of an earlier judgment obtained by Dr. Harrison against Rowland for the value of veterinary services rendered to Kluwall during the period of the alleged malpractice.

I.
Rowland filed suit against Harrison on April 13, 1988 in the Circuit Court for Baltimore County. She alleged in her complaint that Harrison maintained a horse farm in connection with his veterinary practice; that on June 8, 1986, she took the horse to Harrison's farm to be boarded and treated for a vaginal infection; that Kluwall was in otherwise good condition on June 8 but thereafter contracted the disease of colic due to the negligence of Dr. Harrison; and that he failed to treat the horse for the disease. Rowland further alleged that after taking the horse from the farm, Kluwall collapsed from the effects of the disease; that Harrison did not respond to her calls for assistance promptly; and that he misdiagnosed the disease and negligently treated the horse, as a result of which Kluwall had to be destroyed. Rowland claimed damages in the amount of one-half million dollars.
Earlier, on September 24, 1987, Harrison had sued Rowland in the District Court of Maryland, claiming $1,215.56 for professional and boarding services rendered to Kluwall at Rowland's request (the debt action). Rowland's defense to the debt action was "breach of contract in the care and maintenance of ... Kluwall ..., negligent care and maintenance of said horse, negligent rendering of professional services below the reasonable skill, diligence and attention ordinarily expected of a trustworthy veterinarian." On February 1, 1988, Rowland prayed a jury trial and the debt action was removed to the Circuit Court for Baltimore County.
On April 13, 1988, when Rowland filed the malpractice action against Harrison, she moved to consolidate that suit with the debt action. Harrison opposed the motion. He argued that while the cases arose from the same events, they involved totally unrelated issues and constituted "two separate and distinct causes of action." On May 5, 1988, Rowland filed a motion to stay Harrison's debt action, or in the alternative, to consolidate it with her malpractice action. These motions were denied on June 8, 1988. Two days later, counsel for Harrison wrote Rowland, advising that he intended to try the debt action on the scheduled trial date of July 13, and that "the results will be res judicata as to all issues existing between our clients." On June 28, Rowland filed a counterclaim in the debt action, asserting the same claim that she had filed against Harrison in her malpractice action.
On the day of trial of the debt action before Judge J. William Hinkel, Rowland sought a postponement or a severance of her counterclaim. She said that while she was prepared to present a defense to the debt action, she was concerned with the potential res judicata effect of a judgment in the debt action; that she had not had adequate time for discovery in her malpractice action; and was not then in a position to present expert witness testimony. Rowland's motion was denied and the case proceeded to trial before Judge Hinkel without a jury. At the conclusion of the evidence presented by Harrison, the docket entries show that Rowland unsuccessfully moved for judgment in her favor.[1] At this point in the proceedings, Rowland moved for a voluntary dismissal of her counterclaim without prejudice. Once again, she maintained that she could not go forward on her counterclaim without the availability of expert witnesses and had not had adequate time for discovery. Judge Hinkel dismissed the counterclaim without prejudice. He said:
"[T]hat's appropriate under all the circumstances. It will merely be a dismissal without statement by the court because ... there may be other problems that arise from having filed it and not pursued it, and whether or not that will have some effect on the other case that's still pending in this court, I don't know."
Judge Hinkel entered judgment in the debt action in favor of Harrison. His decision, he said, was based "on the evidence presented" which showed that the services were rendered at Rowland's request and that payment had not been made. Judge Hinkel explained that his decision was "strictly on the debt due," and that it did not "deal[] with a question of whether or not there was negligence, because there is just not evidence here sufficient to make that kind of judgment." In so holding, the court said that "since the counter-claim has been dismissed, [Rowland] doesn't have the proof to support [a] setoff." In this regard, Judge Hinkel observed that Rowland's "feeling" that Harrison was responsible for Kluwall's illness did not constitute evidence "that would persuade me to award a setoff in the case."
Rowland did not appeal from the judgment in the debt action. Subsequently, a motion for summary judgment was filed by Harrison in Rowland's malpractice action. The motion recited that the debt action was resolved in Harrison's favor; that at that trial Rowland "put forth evidence of Harrison's alleged malpractice and negligent supervision and/or staffing of [his] horse farm"; and that consequently the malpractice action is "barred by both the doctrines of res judicata and collateral estoppel."
Judge John F. Fader, II granted summary judgment for Harrison. He first noted that there was no transcript of the testimony adduced at trial of the debt action. He next recognized that Judge Hinkel's decision in Harrison's favor in the debt action did not deal with whether Harrison was negligent but was "strictly on the debt due." Nevertheless, Judge Fader concluded that the doctrine of direct res judicata barred the further prosecution of Rowland's malpractice suit. He said the doctrine "establishes that in a subsequent action between the same parties upon the same cause of action ..., a judgment rendered on the merits constitutes an absolute bar as to all matters which were actually raised, litigated and determined in the former proceeding, as well as to all matters which could have been raised and litigated." Applying this doctrine, Judge Fader held that Rowland's failure to litigate the issue of Harrison's malpractice as a defense or by counterclaim in the debt action resulted in her being precluded "from litigating that issue unless some other compelling issue allows the counterclaim to survive." In so holding, Judge Fader said that the "compulsory counterclaim rule" was in effect in Maryland and required that Rowland "assert her malpractice defense to Harrison's suit for services rendered or lose her right to litigate that issue under the doctrine of res judicata." Judge Fader found it "apparent" that the dismissal of the counterclaim without prejudice was because Rowland was not prepared to go ahead with her malpractice claim in the debt action. He pointed out that under Maryland Rule 2-503(b) the court could have ordered a separate trial of Rowland's counterclaim, as she requested, but it did not do so. Consequently, the court held that the voluntary dismissal of the counterclaim without prejudice did not preclude the application of the doctrine of res judicata since it had the same effect as if the counterclaim had never been filed. Judge Fader explained:
"The doctrine of res judicata holds that the malpractice claim, whether asserted as a defense or as a counter-complaint seeking money damages, must be brought or it will be lost as a right to the party."
Upon Rowland's appeal to the Court of Special Appeals, we granted certiorari prior to decision by that court to decide the important question raised in the case.

II.
Rowland contends that as negligence was neither litigated nor determined in the debt action, either by way of defense or counterclaim, res judicata does not bar her malpractice action. Specifically, she argues that as her counterclaim was dismissed without prejudice, it does not operate as an adjudication on the merits. She further maintains that Judge Fader erroneously held that Maryland has a compulsory counterclaim rule. On the contrary, she claims that Maryland's counterclaim rule (Rule 2-331(a)) is purely permissive. Rowland recognizes that she pleaded Harrison's negligence as a defense in his debt action. But that alone, she says, does not suffice to bar prosecution of her malpractice action within the contemplation of the res judicata doctrine when, as here, the first suit was for a simple debt approximating $1,000 and the subsequent action involved a complex malpractice claim for half-million dollars.

(A)
Our cases have consistently defined the doctrine of res judicata in these terms: a judgment between the same parties and their privies is a final bar to any other suit upon the same cause of action, and is conclusive, not only as to all matters that have been decided in the original suit, but as to all matters which with propriety could have been litigated in the first suit. Shum v. Gaudreau, 317 Md. 49, 54, 562 A.2d 707 (1989); Higgins v. Barnes, 310 Md. 532, 549, 530 A.2d 724 (1987); Cook v. State, 281 Md. 665, 668-89, 381 A.2d 671 (1978); MPC, Inc. v. Kenny, 279 Md. 29, 32, 367 A.2d 486 (1977); Missler v. Anne Arundel County, 271 Md. 70, 77, 314 A.2d 451 (1974); Shoreham v. Randolph Hills, 269 Md. 291, 302, 305 A.2d 465 (1973); Nicholson v. Unsat. C. & J. Fund Bd., 265 Md. 453, 458-60, 290 A.2d 384 (1972); Arundel Asphalt v. Morrison-Johnson, Inc., 256 Md. 170, 173, 259 A.2d 789 (1969); Pat Perusse Realty v. Lingo, 249 Md. 33, 35, 238 A.2d 100 (1968); Sterling v. Local 438, Etc., 207 Md. 132, 140-41, 113 A.2d 389 (1955). Applying this definition in Higgins, 310 Md. at 549, 530 A.2d 724, we said that "a plaintiff must assert all claims arising out of a particular transaction against a particular defendant or be barred from asserting them later."[2]
Assuming, without deciding, that in this case the debt action and the malpractice action constitute the same cause of action for purposes of applying the res judicata doctrine, the record before us does not show that the issue of negligence was either litigated or determined by Judge Hinkel in the debt action. As earlier observed, the record does not contain the transcript of the trial of the debt action, but only excerpts from Judge Hinkel's remarks in granting judgment in Harrison's favor. The dismissal of the counterclaim without prejudice did not, of course, constitute an adjudication of the negligence issue, nor did Judge Hinkel's disposition of the case purport to determine from evidence introduced at the trial that Harrison was not negligent in his treatment of Kluwall. He simply stated that no evidence was adduced justifying any setoff from the amount of Harrison's claim for professional and boarding services rendered. The judgment for Harrison, according to Judge Hinkel's oral ruling, was based on Harrison's showing that the services were rendered and that the amount claimed was due. The record thus fails to demonstrate that Harrison's alleged negligence was litigated and determined in the debt action.
Harrison's reliance upon Felger v. Nichols, 35 Md. App. 182, 370 A.2d 141 (1977) to support the application of res judicata by Judge Fader is misplaced. In that case, the plaintiff sued his lawyer for malpractice. Previously, the lawyer had sued the client for a fee and the client had defended on grounds of the lawyer's excessive fees and inadequate service. Because the lawyer's skill, fidelity, and diligence were at issue and litigated in the fee suit, the court's determination in the earlier suit barred the latter suit for inadequate legal representation dependent on those same determinations. Unlike Felger, the question of negligence in the present case, although raised in a defensive pleading, was not litigated and determined.
Moreover, we agree with Rowland that Judge Fader was in error when he concluded that the Maryland counterclaim rule is compulsory and required that she assert her malpractice claim in Harrison's debt action or lose her right to litigate that matter under the doctrine of res judicata.
Maryland Rule 2-331(a) provides:
"(a) Counterclaim Against Opposing Party.  A party may assert as a counterclaim any claim that party has against any opposing party, whether or not arising out of the transaction or occurrence that is the subject matter of the opposing party's claim. A counterclaim may or may not diminish or defeat the recovery sought by the opposing party. It may claim relief exceeding in amount or different in kind from that sought in the pleading of the opposing party."
In Higgins, supra, 310 Md. at 549, 530 A.2d 724, we commented that the Court of Special Appeals, applying res judicata principles in Felger, precluded a defendant from asserting a counterclaim in a subsequent action that arose from a transaction involved in prior litigation. We there remarked that while "the Maryland Rules of Procedure do not speak of compulsory counterclaims, our broad definition of res judicata will, in many cases, have the same effect." Id. At the same time, we acknowledged in Higgins that the Court has never "had to confront the effect of res judicata on the assertion of counterclaims." Id. Thus, this is our first opportunity to consider the issue and we turn for guidance to § 22 of the Restatement (Second) of Judgments (1982), which provides:
"(1) Where the defendant may interpose a claim as a counterclaim but he fails to do so, he is not thereby precluded from subsequently maintaining an action on that claim, except as stated in Subsection (2).
"(2) A defendant who may interpose a claim as a counterclaim in an action but fails to do so is precluded, after the rendition of judgment in that action, from maintaining an action on the claim if:
(a) The counterclaim is required to be interposed by a compulsory counterclaim statute or rule of court, or
(b) The relationship between the counterclaim and the plaintiff's claim is such that successful prosecution of the second action would nullify the initial judgment or would impair rights established in the initial action."
Comment a of the Restatement states, as the rationale for § 22(1), that in the absence of a compulsory counterclaim rule, "the defendant normally has the option of interposing a claim as a counterclaim or of bringing a separate action against the plaintiff." The Comment further explains that "[t]he justification for the existence of such an option is that the defendant should not be required to assert his claim in the forum or the proceeding chosen by the plaintiff but should be allowed to bring suit at a time and place of his own selection."
The general principle of allowing counterclaims in the absence of a compulsory counterclaim rule has been adopted in a number of jurisdictions. See, e.g., Graham v. Sisco, 248 Ark. 6, 449 S.W.2d 949, 950 (1970); Meyer v. Vance, 406 P.2d 996, 999 (Okla. 1965); Buck v. Mueller, 221 Or. 271, 351 P.2d 61, 64 (1960); Strunk v. Bennett, 258 S.W.2d 517, 518-19 (Ky. 1953); Leslie v. Brown Bros. Incorporation, 208 Cal. 606, 283 P. 936, 942 (1929); Seager v. Foster, 185 Iowa 32, 169 N.W. 681, 682 (1918); Maramen v. Thompson, 46 Ala.App. 377, 243 So.2d 34, 36 (1971); Frank M. Herbert, Inc. v. M & P Scrap Iron & M. Corp., 41 Misc.2d 1020, 247 N.Y.S.2d 193, 197 (1964); Mechanical Devices Co. v. General Builders, 27 N.J. Super. 501, 99 A.2d 605, 606 (1953), rev'd on other grounds, 15 N.J. 566, 105 A.2d 673; Stoner v. Stoner, 351 Ill. App. 304, 115 N.E.2d 103, 106 (1953); State v. Calhoun, 87 Ohio App. 1, 93 N.E.2d 317, 320 (1950); Jackson v. Farmers Union Livestock Commission, 238 Mo. App. 449, 181 S.W.2d 211, 220 (1944); see generally, 2 Freeman on Judgments § 786 (5th ed. 1925); 2 Black on Judgments § 769 (2nd ed. 1902).
Maryland's counterclaim rule, by its plain terms, is permissive and not mandatory. See P. Niemeyer and L. Richards, Maryland Rules Commentary (1984), noting in commentary at 167, that Maryland Rule § 2-331 is not compulsory and need not be asserted in the existing action, although "under certain circumstances, the doctrine of res judicata may bar the subsequent action," citing Alvey v. Alvey, 225 Md. 386, 171 A.2d 92 (1961). Under § 22(2)(a) of the Restatement, a counterclaim need not be filed and does not therefore preclude a subsequent action on that claim, in the absence of a compulsory counterclaim rule or statute. We may not, therefore, apply our definition of res judicata so broadly as to change the thrust of Maryland Rule 2-331 to one that is compulsory.
Notwithstanding the permissive nature of the Maryland counterclaim rule, Harrison refers us to Singer v. Steven Kokes, Inc., 39 Md. App. 180, 182, 384 A.2d 463 (1978) for the proposition "that a party must raise all defenses he has to a cause of action and once that action is concluded he cannot use a defensive matter as a basis for relief in a subsequent action between the parties." He further notes that in World Wide Imp. Car v. Savings Bk., 41 Md. App. 263, 396 A.2d 547 (1979), the court reiterated that view after stating the general rule that the doctrine of res judicata does not apply to a counterclaim "not required to be raised in defense of an earlier action." Id. at 273, 396 A.2d 547 (emphasis in original).
Comment b to § 22 of the Restatement addresses situations in which the same facts that constitute a defense are grounds for a counterclaim; it explains that "[i]n the absence of a statute or rule of court otherwise providing, the defendant's failure to allege certain facts either as a defense or as a counterclaim does not normally preclude him from relying on those facts in an action subsequently brought by him against the plaintiff." The Comment also teaches that although the defendant's "failure to interpose a defense to the plaintiff's claim precludes [him] from thereafter asserting the defense as a basis for attacking the judgment[,] his claim against the plaintiff is not normally merged in the judgment given in that action, and issue preclusion does not apply to issues not actually litigated...."
Illustration 2, following Comment b, although not directly analogous, is a useful example.
"A, a physician, brings an action against B for the price of medical services rendered to B. B fails to plead and judgment by default is given against him. B is not precluded from subsequently maintaining an action against A for malpractice relating to the services sued upon in the prior action. (B is precluded, however, from seeking restitution of any amount paid pursuant to the judgment. See Comment f.)"
Comment c teaches that where both a counterclaim and defense are grounded in the same facts and "the defendant alleges those facts as a defense but not a counterclaim, and after litigation of the defense judgment is given for the plaintiff, the rules of issue preclusion apply." The comment states further that "those rules will normally preclude relitigation ... of issues determined in the first proceeding."
Illustration 4, following Comment c, provides another useful example.
"A, a physician, brings an action against B for the price of medical services rendered to B. B in his answer alleges that A was negligent and that the services were of no value. It is determined that A was not negligent, and judgment is given for A. B is precluded from thereafter relitigating the issue of A's negligence in an action against A for injuries caused by A's alleged malpractice relating to the services sued upon in the prior action."
The case before us does not neatly fit within either illustration. Judgment for Harrison was not by default, and no determination was made that Harrison was not negligent.[3] Although negligence was alleged, it was not actually litigated and determined.
Thus, given the permissive nature of our counterclaim rule and the position taken by the Restatement, which we adopt,[4] we hold that where the same facts may be asserted as either a defense or a counterclaim, and the issue raised by the defense is not litigated and determined so as to be precluded by collateral estoppel,[5] the defendant in the previous action is not barred by res judicata from subsequently maintaining an action on the counterclaim.
Nor does this case fit the description in § 22(2)(b) of the Restatement which would preclude Rowland's claim if it "would nullify the initial judgment or would impair rights established in the initial judgment." Comment f addresses § 22(2)(b) and explains that despite the permissive nature of the general rule "[t]here are occasions when allowance of a subsequent action would so plainly operate to undermine the initial judgment that the principle of finality requires preclusion of such an action." The Comment warns, however, that for Subsection (2)(b) to apply "it is not sufficient that the counterclaim grow out of the same transaction or occurrence as the plaintiff's claim, nor is it sufficient that the facts constituting a defense also form the basis of the counterclaim. The counterclaim must be such that its successful prosecution would nullify the judgment...."
There is no merit to Harrison's argument that if Rowland were allowed to litigate her malpractice claim and were to prevail, that judgment would nullify the judgment obtained by him in the debt action. It is one thing to say that a successful assertion of a defense of negligence would have defeated the debt action, and quite another to say that a successful prosecution of the malpractice action would nullify the enrolled judgment in the debt action.
Comment f gives examples of subsequent judgments which would nullify previous judgments such as "allowing the defendant to enjoin enforcement of the [previous] judgment, or to recover on a restitution theory the amount paid pursuant to the judgment (see Illustration 9), or by depriving the plaintiff in the first action of property rights vested in him under the first judgment (see Illustration 10)."[6] Illustration 2, which refers to comment f, recognizes that after receiving a default judgment against a patient for medical services rendered, the patient may subsequently maintain a malpractice action, but "is precluded ... from seeking restitution of any amount paid pursuant to the [previous] judgment." This is the concern highlighted by § 22(2)(b) and Comment f. Were Rowland to successfully prosecute her malpractice action against Harrison, she would be entitled to whatever amount of damages are determined, but could not recover the fees paid for the treatment of the horse.
We hold that the aspect of the doctrine of res judicata which acts as a final bar to all matters which could with propriety have been litigated in the first suit does not apply with respect to Rowland's malpractice action and that Judge Fader was in error in granting summary judgment for Harrison.
JUDGMENT REVERSED; CASE REMANDED TO THE CIRCUIT COURT FOR BALTIMORE COUNTY FOR FURTHER PROCEEDINGS IN ACCORDANCE WITH THIS OPINION. COSTS TO BE PAID BY APPELLEE.
NOTES
[*]  Blackwell, J., now retired, participated in the hearing and conference of this case while an active member of this Court but did not participate in the decision and adoption of this opinion.
[1]  The docket entries reflect that testimony was taken, but no part of the transcript of that testimony is in the record before us.
[2]  In Kent County Bd. of Educ. v. Bilbrough, 309 Md. 487, 525 A.2d 232 (1987), we adopted the "transaction" test in § 24 of the Restatement (Second) of Judgments (1982) in determining whether two causes of action are the same. Under this test, all rights of the plaintiff to remedies against the defendant are extinguished with respect to all or any part of the transaction, or series of connected transactions, out of which the action arose. According to the Restatement, § 24, "[w]hat factual grouping constitutes a `transaction', and what groupings constitute a `series', are to be determined pragmatically, giving weight to such considerations as whether the facts are related in time, space, origin, or motivation, whether they form a convenient trial unit, and whether their treatment as a unit conforms to the parties' expectations or business understanding or usage."
[3]  Numerous cases have held that a default judgment for a physician for fees due does not bar a subsequent malpractice action on the same services sued upon in the default judgment. See, e.g., Gwynn v. Wilhelm, 226 Or. 606, 360 P.2d 312, 316 (1961); Jordahl v. Berry, 72 Minn. 119, 75 N.W. 10, 13 (1898); Lawson v. Conaway, 37 W. Va. 159, 16 S.E. 564, 569 (1892); Sykes v. Bonner, 1 Cin.Super.Ct.Rep'r. 464, 468 (Ohio 1871). Other cases, in which the patient appeared, but did not allege malpractice as a counterclaim or as a defense to the debt action, have also held that a subsequent malpractice action was not barred. See, e.g., Barton v. Southwick, 258 Ill. 515, 101 N.E. 928, 930 (1913); Sale v. Eichberg, 105 Tenn. 333, 59 S.W. 1020, 1024-25 (1900); Ressequie v. Byers, 52 Wis. 650, 9 N.W. 779, 781 (1881). However, in at least one case the plaintiff's malpractice action was barred because he appeared in the physician's action for fees and alleged malpractice as a defense. Leslie v. Mollica, 236 Mich. 610, 211 N.W. 267, 269 (1926).
[4]  A number of jurisdictions have referred favorably to § 22 of the Restatement. See, e.g., County of Cook v. Midcon Corp., 773 F.2d 892, 908 n. 10 (7th Cir.1985); Towers, Perrin, Forster & Crosby, Inc. v. Brown, 732 F.2d 345, 348 (3rd Cir.1984); Lee v. City of Peoria, 685 F.2d 196, 201 (7th Cir.1982); State Exchange Bank of Culver v. Teague, 495 N.E.2d 262, 267-68 (Ind. Ct. App. 1986); McBroom v. Al-Chroma, Inc., 386 N.W.2d 369, 373 (Minn. Ct. App. 1986); Krikava v. Webber, 43 Wash. App. 217, 716 P.2d 916, 918 (1986); Del Turco v. Peoples Home Sav. Ass'n, 329 Pa.Super. 258, 478 A.2d 456, 463 (1984); Diversified Mortg. Inv. v. Viking Gen. Corp., 16 Mass. App. Ct. 142, 450 N.E.2d 176, 179, 183 (1983).
[5]  Collateral estoppel, like the related doctrine of res judicata, bars relitigation of an issue decided in a prior judgment between the same parties whether or not the causes of action are the same. Cassidy v. Board of Education, 316 Md. 50, 62, 557 A.2d 227 (1989); Murray International v. Graham, 315 Md. 543, 547, 555 A.2d 502 (1989). Section 27 of the Restatement (Second) of Judgments (1982) teaches that "[w]hen an issue of fact or law is actually litigated and determined by a valid and final judgment, and the determination is essential to the judgment, the determination is conclusive in a subsequent action between the parties, whether on the same or a different claim." (emphasis added); see Cassidy, supra, 316 Md. at 62, 557 A.2d 227; Murray, supra, 315 Md. at 547, 555 A.2d 502. Harrison's contention that collateral estoppel is somehow applicable in this case is without merit.
[6]  Illustrations 9 and 10 provide as follows:

"9. A brings an action against B for failure to pay the contract price for goods sold and delivered and recovers judgment by default. After entry on final judgment and payment of the price, B brings an action against A to rescind the contract for mutual mistake, seeking restitution of the contract price and offering to return the goods. The action is precluded.
"10. A brings an action against B to quiet title to certain real estate and obtains judgment by default. B then brings an action against A to quiet title to the same property, alleging that at the time of the first action, B had acquired title to the property by adverse possession. The action is precluded."
