                           PUBLISHED

UNITED STATES COURT OF APPEALS
                FOR THE FOURTH CIRCUIT


Q INTERNATIONAL COURIER,               
INCORPORATED,
                Plaintiff-Appellant,
                 v.
GLENN SMOAK; JACK L. WUERKER;                   No. 05-1150
BRENDAN KENNEDY; DENNIS
CORNELIUS; TIM GAY & ASSOCIATES,
PC,
              Defendants-Appellees.
                                       
           Appeal from the United States District Court
        for the Eastern District of Virginia, at Alexandria.
               Leonie M. Brinkema, District Judge.
                         (CA-04-1243-1)

                      Argued: December 1, 2005

                      Decided: March 20, 2006

  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.


                            COUNSEL

ARGUED: Craig Crandall Reilly, RICHARDS, MCGETTIGAN,
REILLY & WEST, P.C., Alexandria, Virginia, for Appellant. Patrick
Hyung-Jin Kim, WILLIAMS & CONNOLLY, Washington, D.C.;
2                Q INTERNATIONAL COURIER v. SMOAK
Richard Thomas Tomar, 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, LAPIDUS, WIGODSKY & NORWIND, P.A.,
Rockville, Maryland, for Appellee Glenn Smoak; John K. Villa, Rich-
ard A. Olderman, Robert M. Cary, WILLIAMS & CONNOLLY,
L.L.P., Washington, D.C., for Appellee Jack L. Wuerker; Haig V.
Kalbian, Mark B. Sandground, 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, VENABLE,
L.L.P., Vienna, Virginia, for Appellee Dennis Cornelius.


                             OPINION

SHEDD, Circuit Judge:

   Glenn Smoak filed an action in Virginia state court ("the first
action") against Q International Courier, Inc. ("Quick") seeking a dec-
laration 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 jurisdic-
tion. 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 sec-
ond 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.

   Quick now appeals, asserting that the district court erred in apply-
ing the federal law of res judicata rather than the Virginia law of res
                  Q INTERNATIONAL COURIER v. SMOAK                     3
judicata, and that its claims are not subject to dismissal under the Vir-
ginia 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 plaintiff’s 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 1,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 exer-
cised his option, the agreement specified that each side would appoint
a qualified appraiser and, if their respective independent stock
appraisals differed 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 essen-
tially valued Smoak’s stock on a pro rata basis with all the outstand-
ing 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 mil-
lion. Quick’s "fair market value" appraisal, on the other hand, valued
Smoak’s stock at approximately $1.1 million. Because these apprais-
als differed by more than 15%, the requirement under the stock option
agreement that both sides jointly appoint a third appraiser was trig-
gered.
4                 Q INTERNATIONAL COURIER v. SMOAK
   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 agree-
ment 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 dif-
ferent appraisals to Smoak before submitting his final "fair 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 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
advisors and determined that — although the stock option agreement
expressly provided for basing the stock repurchase on "fair 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
                  Q INTERNATIONAL COURIER v. SMOAK                     5
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 explana-
tion, 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 inter-
fered with the contractual relationship between Smoak and Quick by
inducing Smoak to breach the stock option agreement. Quick primar-
ily 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 codefendants 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 fed-
eral 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 dis-
trict court granted the defendants’ motion to dismiss. In its ruling
6                 Q INTERNATIONAL COURIER v. SMOAK
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 liti-
gated 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 fed-
eral 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 Mar-
tin Corp., 531 U.S. 497 (2001), decides this issue. In Semtek, a federal
district court in California dismissed the plaintiff’s diversity jurisdic-
tion 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 plaintiff’s causes of
action were the same in both the California and Maryland litigations,
the plaintiff’s 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 plaintiff’s second action based on the preclu-
sive effect of the federal law of res judicata. Id. at 499-500.

   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. Because the Mary-
land state court improperly based its dismissal on the federal rule of
res judicata, the Supreme Court reversed and remanded for the Mary-
land 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 plaintiff’s claims should be precluded. Id.
at 509.

   In this case, the first action — which was based on diversity juris-
diction — was adjudicated in the federal district court sitting in Vir-
                  Q INTERNATIONAL COURIER v. SMOAK                       7
ginia. 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 judi-
cata.

   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., 576 S.E.2d
504, 506 (Va. 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 consid-
ered compulsory counterclaims in the first action under Federal Rule
of Civil Procedure 13(a). See Nottingham v. Weld, 377 S.E.2d 621,
  1
   The defendants argue that the federal rule of res judicata should gov-
ern 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. 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.
8                 Q INTERNATIONAL COURIER v. SMOAK
623 (Va. 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 occur-
rence 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 ques-
tions in the affirmative for the counterclaim to be compulsory." Id.;
Balbir Brar Assocs. v. Consolidated Trading and Servs. Corp., 477
S.E.2d 743, 745 (Va. 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
    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 defen-
dants 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 rele-
vant pleading in the first action can be decided, if necessary, by the dis-
trict court on remand.
                  Q INTERNATIONAL COURIER v. SMOAK                     9
in the first instance. Remand will allow the parties to develop the
record, as the district court deems appropriate, and address these
issues specifically.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
  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 Transp., 434 F.3d 712, 720 (4th Cir. 2006).
