#### Q INTERNATIONAL COURIER, INCORPORATED, Plaintiff-Appellant, v. Glenn SMOAK; Jack L. Wuerker; Brendan Kennedy; Dennis Cornelius; Tim Gay & Associates, PC, Defendants-Appellees.

No. 05-1150.

United States Court of Appeals, Fourth Circuit.

Argued: Dec. 1, 2005.

Decided: March 20, 2006.

*215ARGUED: Craig Crandall Reilly, Richards, McGettigan, Reilly & West, P.C., Alexandria, Virginia, for Appellant. Patrick Hyung-Jin Kim, Williams *&*Connolly, Washington, D.C.; Richard Thomas To-mar, Karp, Frosh, Lapidus, Wigodsky *&*Norwind, P.A., Rockville, Maryland, for Appellees. ON BRIEF: L. Peter Farkas, Robert H. Morse, Farkas *&*Morse, L.L.P., Washington, D.C., for Appellant. J. Philip Kessel, Jack A. Gold, Karp, Frosh, Lapi-dus, Wigodsky & Norwind, P.A., Rockville, Maryland, for Appellee Glenn Smoak; John K. Villa, Richard A. Olderman, Robert M. Cary, Williams *&*Connolly, L.L.P., Washington, D.C., for Appellee Jack L. Wuerker; Haig V. Kalbian, Mark B. Sand-ground, Jr., Kalbian *&*Hagerty, L.L.P., Washington, D.C., for Appellees Brendan Kennedy and Tim Gay *&*Associates, P.C.; William P. Dolan, Philip J. Harvey, Vena-ble, L.L.P., Vienna, Virginia, for Appellee Dennis Cornelius.

Before NIEMEYER, WILLIAMS, and SHEDD, Circuit Judges.

Reversed and remanded by published opinion. Judge SHEDD wrote the opinion, in which Judge NIEMEYER and Judge WILLIAMS joined.

OPINION

SHEDD, Circuit Judge.

Glenn Smoak filed an action in Virginia state court (“the first action”) against Q International Courier, Inc. (“Quick”) seeking a declaration that Quick used an improper basis appraising the value of Smoak’s stock after Smoak exercised his option requiring Quick to purchase his stock. Quick removed this first action to federal district court in the Eastern District of Virginia based on diversity jurisdiction. Quick also filed a counterclaim against Smoak, alleging that Smoak used an improper basis for his stock appraisal and breached the parties’ stock option agreement. After a bench trial, the district court entered judgment substantially in favor of Quick.

Four months after the first action concluded, Quick filed this second action in federal district court seeking damages against Smoak and Jack L. Wuerker, Smoak’s lawyer; Dennis Cornelius, Smoak’s business advisor; Brendan Kennedy, Smoak’s stock appraiser; and Tim Gay *&*Associates (“TGA”), Smoak’s appraisal firm. The district court dismissed this second action based on the federal law of res judicata.

*216Quick now appeals, asserting that the district court erred in applying the federal law of res judicata rather than the Virginia law of res judicata, and that its claims ax-e not subject to dismissal under the Virginia law of res judicata. For the following reasons, we reverse and remand.

I.

In reviewing a district court’s grant of a motion to dismiss, we accept as true the plaintiffs well-pleaded allegations. *Mylan Labs., Inc. v. Matkari,*7 F.3d 1130, 1134 (4th Cir.1993). When entertaining a motion to dismiss on the ground of res judicata, a court may take judicial notice of facts from a prior judicial proceeding when the res judicata defense raises no disputed issue of fact. *Andrews v. Daw,*201 F.3d 521, 524 n. 1 (4th Cir.2000). We review de novo a district court’s grant of a motion to dismiss based on res judicata. *Id.*at 524.

In 1997, Smoak sold his company to Quick, a private corporation, in return for I,166 shares of Quick stock and other consideration. The parties’ agreement gave Smoak until September 2002 the option of requiring Quick to repurchase all of his stock at its “fair market value ... as determined by independent appraisers.” J.A. 29. If Smoak exercised his option, the agreement specified that each side would appoint a qualified appraiser and, if their respective independent stock appraisals diffei'ed by more than 15%, the parties would jointly appoint a third appraiser to conduct another appraisal.

Smoak exercised his option in August 2002, a month before his option expired. Cornelius advised Smoak to appoint Kennedy of TGA as his independent appraiser. Even though the stock option agreement provided that Smoak’s stock should be appraised at its “fair market value,” the appraisal done by Kennedy that was presented to Quick was based instead on the stock’s “fair value.” This appraisal essentially valued Smoak’s stock on a pro rata basis with all the outstanding stock of the corporation, even though Smoak owned only approximately 10% of Quick’s total shares of stock. This “fair value” appraisal by Kennedy valued Smoak’s stock at approximately $4 million. Quick’s “fair market value” appraisal, on the other hand, valued Smoak’s stock at approximately $1.1 million. Because these appraisals differed by more than 15%, the requirement under the stock option agreement that both sides jointly appoint a third appraiser was triggered.

Rather than attempt to agree on a third appraiser, Smoak instead filed the first action, alleging that the parties actually intended in their agreement to value Smoak’s stock on its “fair value” rather than its “fair market value.” Smoak sought to reform the stock option agreement based either on mutual mistake or Quick’s fraudulent conduct in memorializing their agreement.

In response, Quick filed a counterclaim in the first action, seeking a declaration that the stock option agreement required that Smoak’s stock be appraised at its “fair market value” and that Quick’s $1.1 million appraisal was the only valid appraisal submitted by the parties under the stock option agreement. Quick also alleged that Smoak breached the agreement by filing the first action rather than jointly appointing a third appraiser. Moreover, Quick sought damages for “loss of management time” and attorneys’ fees resulting from Smoak’s preempting the specified appraisal process by filing the first action.

Quick alleges that it learned during the course of discovery and the trial of the first action that Kennedy had actually provided several different appraisals to Smoak before submitting his final “fair *217value” appraisal to Quick. For instance, Kennedy based his first appraisal on “fair market value,” as specified in the stock option agreement, and valued Smoak’s stock at approximately $1.8 million. After learning that Quick had recently purchased another person’s stock, Kennedy used that transaction as a comparable and lowered the “fair market value” of Smoak’s stock to approximately $1.5 million. Disappointed with how low these appraisals were, Smoak met with his codefendant ad-visors and determined that — although the stock option agreement expressly provided for basing the stock repurchase on “fan-market value” — the original intent of the parties was to use “fair value.” Based on this new strategy, Kennedy appraised the “fair value” of Smoak’s stock at approximately $4 million. Smoak presented only this “fair value” appraisal to Quick as its appraisal under the stock option agreement and concealed the prior, much lower appraisals.

Following a bench trial, the district court determined that the stock option agreement unambiguously required the use of “fair market value” appraisals and that there was no basis to reform the agreement to use “fair value” appraisals. The district court also concluded that Smoak breached the stock option agreement and acted in bad faith by filing the first action rather than jointly appointing a third appraiser. In particular, the district court found that Smoak “hid [the prior, much lower] appraisals during the extremely contentious discovery process” and that the “actions of Smoak’s representatives more than hint at impropriety.” J.A. 59. Based on these findings, the district court declared that Quick’s $1.1 million appraisal was the only valid appraisal and the proper value for Quick to pay for Smoak’s stock.

As for Quick’s claim for damages for “lost management time,” the district court granted judgment in favor of Smoak because Quick failed to produce sufficient evidence to measure these damages. The district court also denied Quick’s claim for attorneys’ fees because the provision in the stock option agreement providing for attorneys’ fees to Quick had expired. Last, the district court denied, without explanation, Quick’s claim for litigation expenses against Wuerker under 28 U.S.C. § 1927.

Four months after the district court entered final judgment in the first action, Quick filed this second action. Quick generally alleges that the defendants conspired to conceal the initial, lower appraisals and to bring the first action in bad-faith to defraud Quick into paying a much higher price for Smoak’s stock. In Count I, Quick alleges that defendants Wuerker, Cornelius, Kennedy, and TGA tortiously interfered with the contractual relationship between Smoak and Quick by inducing Smoak to breach the stock option agreement. Quick primarily seeks to recover the attorneys’ fees and the lost management time it was required to expend in the first action. In Count II, Quick asserts that Smoak conspired with his codefen-dants to breach the stock option agreement. In addition to the damages in Count I, Quick also seeks an award of punitive damages under Count II. Count III is a Virginia statutory claim alleging that the defendants conspired to maliciously injure Quick in its reputation or business and seeking to recover treble damages and attorneys’ fees.

The defendants moved to dismiss the second action based on res judicata. In response, Quick argued that neither the Virginia nor federal law of res judicata barred it from bringing its claims in the second action. Basing its decision on the federal law of res judicata, the district *218court granted the defendants’ motion to dismiss. In its ruling from the bench, the district court stated: “I think the record is clear that there was a common core of operative facts that were fully litigated in that first case that [Quick] is trying to essentially relitigate in this case.” J.A. 172. Quick now appeals.

II.

A.

Quick first argues that the district court erred by applying the federal law of res judicata rather than the Virginia law of res judicata in deciding the motion to dismiss. We agree.

The Supreme Court’s opinion in *Semtek Int’l Inc. v. Lockheed Martin Corp.,*531 U.S. 497, 121 S.Ct. 1021, 149 L.Ed.2d 32 (2001), decides this issue. In *Semtek,*a federal district court in California dismissed the plaintiffs diversity jurisdiction lawsuit based on California’s two-year statute of limitations. Thereafter, the same plaintiff sued the same defendant in a second action in Maryland state court. Although the plaintiffs causes of action were the same in both the California and Maryland litigations, the plaintiffs claims were timely filed in Maryland state court under Maryland’s three-year statute of limitations. Rather than apply the Maryland three-year statute of limitations, however, the Maryland state court dismissed the plaintiffs second action based on the pre-clusive effect of the *federal*law of res judicata. *Id.*at 499-500, 121 S.Ct. 1021.

The Supreme Court disagreed, concluding that the “law that would be applied by state courts in the State in which the [first] federal diversity court sits” determines the claim-preclusive effect of the judgment rendered in the first action. *Id.*at 508, 121 S.Ct. 1021. Because the Maryland state court improperly based its dismissal on the federal rule of res judicata, the Supreme Court reversed and remanded for the Maryland state court to apply the California state law of res judicata— the law of the state where the federal district court sat in the first action — to determine whether the plaintiffs claims should be precluded. *Id.*at 509, 121 S.Ct. 1021.

In this case, the first action- — which was based on diversity jurisdiction — was adjudicated in the federal district court sitting in Virginia. Under *Semtek,*the preclusive effect, if any, of the first action on the second action should have been decided under the res judicata law of the state of Virginia — the law of the state where the federal district court sat in the first action. Thus, we hold that the district court erred by applying the federal law of res judicata rather than the Virginia state law of res judicata.1

B.

Quick next argues that we should reverse the judgment because the Virginia state law of res judicata does not preclude its claims in this action. The defendants, on the other hand, argue that Quick’s claims in this second action are precluded under Virginia’s law of res judicata.

*219 Under Virginia law, res judicata has four elements: (1) identity of the remedy sought; (2) identity of the cause of action; (3) identity of the parties; and (4) identity of the quality of the persons for or against whom the claim is made. *Davis v. Marshall Homes, Inc.,*265 Va. 159, 576 S.E.2d 504, 506 (2003). The party asserting the defense of res judicata has the burden of proving by a preponderance of the evidence that the new claim is precluded by a prior judgment. *Id.*

Although the parties agree that these are the four elements under the Virginia law of res judicata, neither party has argued that Virginia also has a specific res judicata rule for cases—like the instant one—in which the first action was litigated in federal district court. In such a circumstance, the initial question under-Virginia law is whether the claims filed in the second action would have been considered compulsory counterclaims in the first action under Federal Rule of Civil Procedure 13(a). *See Nottingham v. Weld,*237 Va. 416, 377 S.E.2d 621, 623 (1989) (“[W]e look to the federal courts’ constructions of the preclusive effect of a failure to file a compulsory counterclaim in the federal court”). If the claims asserted in the second action would have been considered compulsory counterclaims under Rule 13(a) in the first action, the claims will be precluded in the second action. *See id.*

Rule 13(a) provides that a “pleading shall state as a counterclaim any claim which at the time of serving the pleading the pleader has against any opposing party, if it arises out of the transaction or occurrence that is the subject matter of the opposing party’s claim and does not require for its adjudication the presence of third parties of whom the court cannot acquire jurisdiction.”2 The following four inquiries are relevant in considering whether a counterclaim is compulsory: (1) whether the issues of fact and law in the claim and counterclaim are essentially the same; (2) whether res judicata would bar a subsequent suit on the counterclaim absent the compulsory counterclaim rule; (3) whether the same evidence would support or refute the claim and the counterclaim; and (4) whether there is a logical relationship between the claim and the counterclaim. *Painter v. Harvey,*863 F.2d 329, 331 (4th Cir.1988). However, “[a] court need not answer all these questions in the affirmative for the counterclaim to be compulsory.” *Id.; Balbir Brar Assocs. v. Consolidated Trading and Servs. Corp.,*252 Va. 341, 477 S.E.2d 743, 745 (1996). Instead, these inquiries work “less [like] a litmus” test and “more [like] a guideline.” *Painter,*863 F.2d at 331.

Rather than determine whether the claims that Quick now asserts against the defendants would have constituted compulsory counter-claims under Rule 13(a) in the first action, or if not, whether Quick’s current claims would otherwise be precluded under Virginia law, we will instead remand the case to the district court to decide these issues in the first instance. Remand will allow the parties to develop the record, as the district court deems appropriate, and address these issues spe*220cifically.3

III.

For the foregoing reasons, we reverse the judgment of the district court and remand for further proceedings consistent with this opinion.

*REVERSED AND REMANDED*

1

. The defendants argue that the federal rule of res judicata should govern because this case falls within the special exception carved out by the *Semtek*Court that the federal law of res judicata should be used in those circumstances in which "the state [res judicata] law is incompatible with federal interests." 531 U.S. at 509, 121 S.Ct. 1021. The defendants primarily argue that *Semtek*should be limited to procedural issues like statutes of limitations. We disagree and conclude that the Virginia law of res judicata is not incompatible with any federal interest in this case.

2

. There may be a question whether Quick knew or should have known "at the time of serving [its] pleading" in the first action that the defendants conspired to defraud Quick. Before formally exercising his option in September 2002, Smoak proposed to Quick several alternatives to using the "fair market value” appraisal process specified in the stock option agreement. Whether this information would have given rise to a claim of tortious interference or conspiracy when Quick served its relevant pleading in the first action can be decided, if necessary, by the district court on remand.

3

. The defendants also argue several alternative grounds for affirmance. Although we are not precluded from addressing these arguments, we deem it more appropriate to allow the district court to consider them, if necessary, in the first instance on remand. *See Davani v. Virginia Dep’t of Tramp.,*434 F.3d 712, 720 (4th Cir.2006).