
840 N.E.2d 286 (2005)
362 Ill. App.3d 523
298 Ill.Dec. 516
Mary B. CORCORAN-HAKALA, Plaintiff-Appellant,
v.
Joseph P. DOWD, Defendant-Appellee.
No. 2-05-0100.
Appellate Court of Illinois, Second District.
November 22, 2005.
Rehearing Denied January 9, 2006.
*288 Charles A. Cohn, Erwin Cohn, Cohn & Cohn, Chicago, for Mary B. Corcoran-Hakala.
Philip J. McGuire, Law Offices of Philip J. McGuire, Chicago, for Joseph P. Dowd.
Justice HUTCHINSON delivered the opinion of the court:
Plaintiff, Mary B. Corcoran-Hakala, appeals the dismissal of her complaint against defendant, attorney Joseph P. Dowd. She argues that the trial court erred in finding her suit barred by res judicata. Because her complaint grows out of the same operative facts as a prior proceeding between the parties, and because she could have raised all of her claims in that earlier litigation, we affirm.

I. BACKGROUND
Plaintiff's husband was a railroad employee, who was struck and killed by a train while working on a track in Chicago. Testing revealed that plaintiff's husband had cocaine in his system at the time of the accident. After her husband's death, plaintiff negotiated on her own for a settlement with the railroads involved. At some point, a friend introduced her to defendant, who told her that she needed a lawyer. Plaintiff admits that defendant took her to the law firm of Corboy & Demetrio (the Firm), although she claims that, because her father knew Phillip Corboy, she had always planned to hire the Firm. Whatever her reasons for contacting the Firm, plaintiff entered into a written contract (Contingency Agreement) with the Firm to represent her in a suit against the railroads. The Contingency Agreement entitled the Firm to receive 25% of any recovery, with 40% of that amount going to defendant as the referring attorney. The Firm then filed a wrongful death action on plaintiff's behalf against the railroads in the circuit court of Cook County.
During the pretrial proceedings, the railroads offered to settle plaintiff's claim for $1.4 million. The railroads had previously offered plaintiff this same amount to settle the matter before the involvement of defendant and the Firm. The Firm recommended that she accept the settlement based upon its belief that evidence of her husband's drug use would diminish her chances of winning at trial. Plaintiff accepted the settlement.
Apparently because it had been unable to increase plaintiff's recovery beyond the amount previously offered, the Firm waived its fee. Defendant, however, sought to enforce his right to a referral fee under the Contingency Agreement. To this end, he filed a fee petition in the wrongful death action that was pending in the circuit court of Cook County. In an attempt to avoid the legal effect of the Contingency Agreement, plaintiff argued that, based on the amount of work defendant had performed, the agreement was unreasonable. Alternatively, plaintiff argued that, because of a mutual mistake of fact, the Contingency Agreement should be rescinded.
*289 The trial court granted the fee petition and ordered plaintiff to pay defendant his fee. Specifically, the trial court ordered plaintiff to pay $140,000. The Appellate Court, First District, affirmed. See Corcoran v. Northeast Illinois Regional Commuter R.R. Corp., 345 Ill.App.3d 449, 280 Ill.Dec. 857, 803 N.E.2d 87 (2003).
After the Illinois Supreme Court denied her petition for leave to appeal, plaintiff filed the instant suit against defendant in the circuit court of Lake County. Plaintiff's complaint consisted of three counts alleging malpractice (count I), fraud (count II), and entitlement to punitive damages (count III). In count I, plaintiff alleged that, if she and defendant had an attorney-client relationship, defendant had committed legal malpractice by failing to properly advise her before she signed the Contingency Agreement. Alternatively, she alleged in count II that, if she and defendant did not have an attorney-client relationship, defendant had committed fraud by representing to the Firm that they had such a relationship. In count III, plaintiff alleged that defendant's conduct was malicious, outrageous, and egregious and that she was entitled to recover punitive damages in addition to the $140,000 she had been ordered to pay defendant under the Contingency Agreement.
Defendant filed a motion to dismiss pursuant to sections 2-615 and 2-619 of the Code of Civil Procedure (Code) (735 ILCS 5/2-615, 2-619 (West 2002)). The section 2-619 motion asserted res judicata. On that ground, the trial court dismissed the malpractice count of plaintiff's complaint with prejudice, but gave her leave to amend the fraud and punitive damages counts. The trial court then denied plaintiff's request for leave to immediately appeal the dismissal of her malpractice claim. Reserving her claim of error on that count, plaintiff repled fraud and again demanded punitive damages. The court dismissed her amended complaint in its entirety, finding that it was barred by res judicata. Plaintiff filed this timely appeal.

II. ANALYSIS
A motion to dismiss pursuant to section 2-619 admits the legal sufficiency of a complaint, but asserts affirmative matters that avoid or defeat the allegations contained in the complaint. Miner v. Fashion Enterprises, Inc., 342 Ill.App.3d 405, 413, 276 Ill.Dec. 652, 794 N.E.2d 902 (2003). A section 2-619 motion affords litigants a means of disposing of issues of law and easily proved issues of fact at the outset of a case. Van Meter v. Darien Park District, 207 Ill.2d 359, 367, 278 Ill.Dec. 555, 799 N.E.2d 273 (2003). This court reviews de novo the dismissal of a complaint pursuant to section 2-619. Kawaguchi v. Gainer, 361 Ill.App.3d 229, 296 Ill.Dec. 401, 835 N.E.2d 435 (2005).
On appeal, plaintiff contends that the trial court erred in finding that her claims were barred by res judicata. The doctrine of res judicata provides that a final judgment on the merits rendered by a court of competent jurisdiction is conclusive as to the rights of the parties and their privies, and as to them constitutes an absolute bar to a subsequent action involving the same claim, demand, or cause of action. Nowak v. St. Rita High School, 197 Ill.2d 381, 389, 258 Ill.Dec. 782, 757 N.E.2d 471 (2001). Res judicata applies when: (1) a final judgment on the merits was rendered by a court of competent jurisdiction; (2) there is an identity of parties or their privies; and (3) there is an identity of causes of action. Robinson v. Toyota Motor Credit Corp., 201 Ill.2d 403, 411, 266 Ill.Dec. 879, 775 N.E.2d 951 (2002). Res judicata promotes judicial economy by preventing repetitive litigation and also protects parties from being forced *290 to bear the unjust burden of relitigating essentially the same case. Arvia v. Madigan, 209 Ill.2d 520, 533, 283 Ill.Dec. 895, 809 N.E.2d 88 (2004). The bar extends to all matters that were offered to sustain or defeat a claim in the first action, as well as to all matters that could have been offered. Arvia, 209 Ill.2d at 533, 283 Ill.Dec. 895, 809 N.E.2d 88.
In this case, the parties do not dispute that the prior litigation ended in a final judgment on the merits that was rendered by a court of competent jurisdiction. Nor do they dispute that the parties to that litigation are the same as the parties to this litigation. They question only whether there is an identity of causes of action. To answer that question, Illinois courts apply a "transactional" test. Under this test, separate claims will be considered the same cause of action for purposes of res judicata if they arise from a single group of operative facts, regardless of whether they assert different theories of relief. River Park, Inc. v. City of Highland Park, 184 Ill.2d 290, 311, 234 Ill.Dec. 783, 703 N.E.2d 883 (1998).
That is precisely the case here. In the earlier litigation, defendant sought to recover on the Contingency Agreement, and plaintiff responded that the agreement should be rescinded because of a mutual mistake. She also argued that the agreement was unreasonable in light of the amount of work defendant had performed on her case. In other words, plaintiff argued that, based on events surrounding the Contingency Agreement, she should not have to pay the money she owed under the agreement. Plaintiff's arguments did not prevail and she was ordered to pay defendant his fee.
Now, in the instant case, she seeks to recover that amount. She argues that she is entitled to do so because defendant engaged in either malpractice by failing to adequately advise her regarding the Contingency Agreement or fraud by convincing the Firm to include him in the agreement. In other words, she argues that, based on events surrounding the Contingency Agreement, she is entitled to recover the amount she paid on the agreement. Thus, plaintiff's current claims involve the same operative facts as the earlier litigation. Moreover, while the complaint at bar raises theories of relief different from those argued in the earlier case, plaintiff's goal here is the same  i.e., to avoid the legal effect of the Contingency Agreement. All of the arguments plaintiff now raises were available to her in the earlier proceeding and she should have raised them then. Had she done so, and had she prevailed, she would not have had to pay defendant his referral fee. See Bennett v. Gordon, 282 Ill.App.3d 378, 217 Ill.Dec. 924, 668 N.E.2d 109 (1996) (malpractice a defense to attorney's fee petition); Illinois State Bar Ass'n Mutual Insurance Co. v. Coregis Insurance Co., 355 Ill.App.3d 156, 165, 290 Ill.Dec. 394, 821 N.E.2d 706 (2004) (fraud a basis for rescission). However, she chose not to raise these arguments, and res judicata prohibits her from doing so now. Cabrera v. First National Bank of Wheaton, 324 Ill.App.3d 85, 92, 257 Ill.Dec. 512, 753 N.E.2d 1138 (2001) ("[T]he doctrine [of res judicata] bars claims based on facts that would have constituted a counterclaim or defense in the earlier proceeding where successful prosecution of the later action would either nullify the earlier judgment or impair the rights established in the earlier action").
Purmal v. Robert N. Wadington & Associates, 354 Ill.App.3d 715, 289 Ill.Dec. 578, 820 N.E.2d 86 (2004), provides strong support for this conclusion. There, after the plaintiff settled a lawsuit, the law firm representing her filed a petition against her to recover fees pursuant to a contingency *291 agreement. In response, the plaintiff argued that the law firm had not done sufficient work to warrant its fee. Purmal, 354 Ill.App.3d at 718, 289 Ill.Dec. 578, 820 N.E.2d 86. The trial court rejected the plaintiff's argument and ordered her to pay the defendant its fee. After that decision was affirmed on appeal, the plaintiff filed a new suit against the defendant. Purmal, 354 Ill.App.3d at 719, 289 Ill.Dec. 578, 820 N.E.2d 86. In her complaint, the plaintiff alleged, among other things, that the defendant had engaged in malpractice and fraud and she sought, among other things, an award of punitive damages. Purmal, 354 Ill.App.3d at 719, 289 Ill.Dec. 578, 820 N.E.2d 86. The trial court found that res judicata barred the plaintiff's suit, and the appellate court affirmed, reasoning that the plaintiff's claims grew out of the same group of operative facts as the earlier proceeding. See Purmal, 354 Ill.App.3d at 722, 724, 289 Ill.Dec. 578, 820 N.E.2d 86. Additionally, the appellate court rejected the plaintiff's argument that, because her complaint raised issues not raised in the earlier proceeding, res judicata did not apply. Purmal, 354 Ill.App.3d at 725, 289 Ill.Dec. 578, 820 N.E.2d 86. In doing so, the appellate court explained that res judicata bars not only those issues or claims that were raised in the earlier proceeding, but also those that could have been raised. The appellate court stated:
"Purmal fails to understand that res judicata bars all matters that were offered to sustain or defeat the claim in the first action, as well as all matters that could have been offered for that purpose. [Citation.] Thus, even if the [prior] decision did not address all of the issues and cases she now raises, the fact remains that she could have offered all of these matters in response to defendants' fee petition and is now barred from relitigating them here." (Emphasis in original.) Purmal, 354 Ill.App.3d at 725, 289 Ill.Dec. 578, 820 N.E.2d 86.
The facts of Purmal are basically identical to the facts of the present case. Here, defendant petitioned to recover on the Contingency Agreement after plaintiff settled a lawsuit covered by the agreement. Plaintiff alleged that defendant was not entitled to recover on the contract because, among other reasons, he did insufficient work to warrant his fee. After losing the fee petition litigation, the plaintiff filed a new suit complaining of malpractice and fraud. Those claims were available to her in the earlier litigation, but she chose not to raise them. Consequently, here, as in Purmal, plaintiff cannot raise those claims now. They are barred by res judicata.
In an attempt to avoid this conclusion, plaintiff relies on two divorce cases. In the first of these cases, Wilson v. M.G. Gulo & Associates, Inc., 294 Ill.App.3d 897, 229 Ill.Dec. 402, 691 N.E.2d 875 (1998), which was decided before the Illinois Supreme Court adopted the transactional test for addressing questions of res judicata, a divided panel of the Illinois Appellate Court, Third District, concluded that res judicata did not bar a divorcee's malpractice suit against her former attorney. In her suit, the plaintiff had alleged that her attorney had negligently failed to investigate her and her ex-husband's marital assets. The attorney responded that the suit was barred because the divorce court, in ruling on a fee petition, had already rejected the plaintiff's contest to the number of hours the attorney had billed. In rejecting the attorney's argument, the majority reasoned that the earlier decision had not dealt with the reasonableness of the attorney's representation. Wilson, 294 Ill.App.3d at 901, 229 Ill.Dec. 402, 691 N.E.2d 875. The majority reasoned further that, because the plaintiff had not contested the reasonableness of the attorney's *292 representation in the earlier proceeding, the reasonableness issue could not have been fully litigated in the earlier proceeding. Wilson, 294 Ill.App.3d at 901, 229 Ill.Dec. 402, 691 N.E.2d 875. In other words, the majority concluded that the issue could not have been fully litigated because the plaintiff had not raised it. Having concluded that the plaintiff had not raised and could not have raised her negligence claim in the earlier proceeding, the majority found that res judicata did not bar the plaintiff's malpractice suit. Wilson, 294 Ill.App.3d at 901, 229 Ill.Dec. 402, 691 N.E.2d 875.
Justice Holdridge dissented. He noted that res judicata bars claims that were raised or could have been raised in an earlier proceeding. Wilson, 294 Ill.App.3d at 902, 229 Ill.Dec. 402, 691 N.E.2d 875 (Holdridge, J., dissenting). Justice Holdridge explained that professional negligence is a defense to a claim for attorney fees. Thus, Justice Holdridge concluded that the plaintiff could have raised the reasonableness of the attorney's representation as a defense in the earlier proceeding and that res judicata barred her from raising it in a subsequent malpractice suit.
Wilson does not disturb our conclusion that res judicata applies in the present case. First, the Wilson court concluded that the plaintiff could not have raised the reasonableness of the attorney's representation in the earlier proceeding. By contrast, in the present case, plaintiff could have raised defendant's alleged malpractice as a defense to his fee petition. She also could have raised his alleged fraud. Indeed, plaintiff argued in the earlier proceeding that the Contingency Agreement should be rescinded, and, although she did so on a theory of mutual mistake, nothing would have prevented her from doing so on a theory of fraud. Thus, here, unlike in Wilson, plaintiff could have raised her current claims in the earlier proceeding.
Second, and more fundamentally, we believe that Wilson was wrongly decided. As Justice Holdridge noted in his dissent, the Wilson plaintiff could have raised the reasonableness issue in the earlier proceeding. Thus, res judicata barred her malpractice suit. We find unconvincing the Wilson majority's conclusion that the reasonableness issue could not have been fully litigated earlier because it was not raised. As noted by Justice Holdridge, the proper consideration is not whether the claim was raised in the earlier proceeding, but whether it could have been.
Plaintiff also relies on Weisman v. Schiller, Ducanto & Fleck, 314 Ill.App.3d 577, 248 Ill.Dec. 143, 733 N.E.2d 818 (2000). In that case, the reviewing court held that res judicata did not bar the plaintiff's malpractice suit against her divorce attorney when, in an earlier proceeding, she was prohibited from raising her malpractice claim. The attorney, who had recovered fees following a hearing held pursuant to section 508 of the Illinois Marriage and Dissolution of Marriage Act (Act) (750 ILCS 5/508 (West 1996)), argued that the plaintiff's malpractice claim was barred by res judicata. The reviewing court rejected this argument and explained that the plaintiff had not been permitted in the earlier proceeding to fully litigate her claim. Weisman, 314 Ill.App.3d at 580, 248 Ill.Dec. 143, 733 N.E.2d 818. This was so, the court stated, for two reasons. First, pursuant to the Act, the trial court in the earlier hearing did not have subject matter jurisdiction over the plaintiff's claim for damages. Weisman, 314 Ill.App.3d at 579, 248 Ill.Dec. 143, 733 N.E.2d 818. Instead, that trial court could consider only whether the plaintiff was liable for the attorney's fees. Second, pursuant to the Act, the plaintiff could not in the earlier *293 proceeding present her claim to a jury. Weisman, 314 Ill.App.3d at 580, 248 Ill.Dec. 143, 733 N.E.2d 818. Rather, the Act limited her to a summary proceeding. Thus, the Weisman court concluded that res judicata did not bar the plaintiff's claim.
Here, plaintiff argues that, like in Weisman, defendant's fee petition was decided in a summary proceeding without an evidentiary hearing. However, the record does not support plaintiff's claim that she was prevented from presenting evidence in the earlier proceeding. The trial court, in ruling on the fee petition, held a hearing and considered the Contingency Agreement and plaintiff's affidavit, along with argument from counsel for both parties. Plaintiff also argues that here, as in Weisman, the nature of the earlier proceeding deprived her of her right to a jury trial and to have her claim for damages fully heard. Plaintiff's argument fails to acknowledge that, unlike the plaintiff in Weisman, she was not statutorily precluded from responding to defendant's fee petition with a counterclaim seeking damages and demanding a jury trial.
Plaintiff alternatively asserts that (1) the trial court precluded her from making a counterclaim and (2) even if she was not precluded from making a counterclaim, she may still make one now, because counterclaims are not mandatory in Illinois. As to plaintiff's first point, the record does not bear out her contention. That is to say, nothing in the record suggests that, had plaintiff sought to make a counterclaim against defendant in the earlier proceeding, she would have been prevented from doing so. Thus, there is no merit to plaintiff's contention that res judicata should not apply because she was prevented from bringing a counterclaim. See generally River Park, 184 Ill.2d at 318, 234 Ill.Dec. 783, 703 N.E.2d 883 ("[W]e cannot agree with plaintiffs that, had they attempted to bring their state claims in federal court, the district court would have dismissed them * * *. * * * [P]laintiffs filed no state claims in federal court. Consequently, we do not know whether the district court would have refused to exercise * * * jurisdiction over these claims").
Plaintiff argues that the above conclusion cannot stand in light of the rule that the party claiming res judicata bears the burden of establishing the doctrine's applicability. See Cload ex rel. Cload v. West, 328 Ill.App.3d 946, 950, 263 Ill.Dec. 35, 767 N.E.2d 486 (2002). However, this rule does not require, as plaintiff seems to suggest, that the moving party conclusively prove a counterfactual conditional  i.e., if plaintiff had made a counterclaim, the court would have heard it. If it did, it is hard to imagine how a defendant could ever establish res judicata. Other cases have not imposed such a burden upon a party to establish the applicability of the res judicata doctrine. See, e.g., River Park, 184 Ill.2d at 318, 234 Ill.Dec. 783, 703 N.E.2d 883; Purmal, 354 Ill.App.3d at 725, 289 Ill.Dec. 578, 820 N.E.2d 86; Estate of Cooper v. Humana Health Plan, Inc., 338 Ill.App.3d 845, 850, 273 Ill.Dec. 461, 789 N.E.2d 361 (2003).
As to plaintiff's second point, it is true that, in Illinois, counterclaims are generally permissive rather than mandatory. See 735 ILCS 5/2-608(a) (West 2002); Marsh v. Nellessen, 235 Ill.App.3d 998, 1001, 176 Ill.Dec. 783, 602 N.E.2d 90 (1992). Thus, a defendant generally may raise his or her claim against the plaintiff by way of a counterclaim or by way of a separate action. Marsh, 235 Ill.App.3d at 1001, 176 Ill.Dec. 783, 602 N.E.2d 90. However, if the defendant's claim involves the same operative facts as the plaintiff's claim, res judicata may bar the defendant from raising his or her claim in a subsequent *294 action. Torcasso v. Standard Outdoor Sales, Inc., 232 Ill.App.3d 500, 503-04, 173 Ill.Dec. 798, 597 N.E.2d 772 (1992), rev'd on other grounds, 157 Ill.2d 484, 193 Ill.Dec. 192, 626 N.E.2d 225 (1993). Specifically, res judicata bars a subsequent action if successful prosecution of that action would in effect nullify the judgment entered in the initial action. Restatement (Second) of Judgments § 22(2)(b) (1982); Carey v. Neal, Cortina & Associates, 216 Ill.App.3d 51, 58, 159 Ill.Dec. 551, 576 N.E.2d 220 (1991) (describing subsection 22(2)(b) of the Restatement as a "`common law' rule of compulsory counterclaim"); see also Cabrera v. First National Bank of Wheaton, 324 Ill.App.3d at 92, 257 Ill.Dec. 512, 753 N.E.2d 1138.
Here, plaintiff's current claims involve the same operative facts as the earlier litigation. Moreover, successful prosecution of plaintiff's current suit would in effect nullify the prior judgment. Thus, res judicata bars plaintiff's suit.
Illustration 9 under section 22 of the Restatement describes facts similar to those presented here. The illustration states as follows:
"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 of 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." Restatement (Second) of Judgments § 22, Illustration 9, at 190 (1982).
Likewise, in the present case, defendant brought an action against plaintiff to recover on the Contingency Agreement. After plaintiff was ordered to pay, she brought an action against defendant, claiming, among other things, that the agreement was procured by fraud and seeking to recover the amount she had paid pursuant to the agreement. Res judicata prohibits this action.
To summarize, plaintiff's current claims arise out of the same operative facts as the prior litigation, and plaintiff could have  and should have  raised those clams in that proceeding. Thus, those claims are barred by res judicata and the trial court properly dismissed plaintiff's suit on this basis.

III. CONCLUSION
For the reasons stated, the judgment of the circuit court of Lake County is affirmed.
Affirmed.
GROMETER and CALLUM, JJ., concur.
