Reversed and remanded by published opinion. Judge SHEDD wrote the opinion, in which Judge NIEMEYER and Judge WILLIAMS joined.
OPINION
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.
*216 Quick 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,
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 Quiсk 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 Smoаk’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 basеd 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 appraisаl 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 *217 value” 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 сomparable 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 optiоn 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 cоntentious 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 clаim 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 agreеment 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 conspirеd 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 brеach 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 damagеs 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 *218 court 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.,
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,
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 othеr 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.,
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,
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 fаct 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,
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 issuеs in the first instance. Remand will allow the parties to develop the record, as the district court deems appropriate, and address these issues spe *220 cifically. 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
Notes
. The defendants arguе 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."
. 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 Quiсk. 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.
. 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.,
