                  FOR PUBLICATION
  UNITED STATES COURT OF APPEALS
       FOR THE NINTH CIRCUIT

THE SCOTTS COMPANY LLC, an             
Ohio limited liability company,
                Plaintiff-Appellant,
                 v.
                                             No. 11-35235
SEEDS, INC., a Washington
corporation; MILLHORN FARMS,                   DC No.
                                           2:10-cv-0327 LRS
INC., an Idaho corporation; MAPLE
LEAF FARMS, INC., a Washington                 OPINION
corporation; TIM FREEBURG, an
Idaho sole proprietor; MICA CREEK,
INC., a Washington corporation,
              Defendants-Appellees.
                                       
        Appeal from the United States District Court
          for the Eastern District of Washington
         Lonny R. Suko, District Judge, Presiding

                   Argued and Submitted
            April 13, 2012—Seattle, Washington

                   Filed August 10, 2012

     Before: Procter Hug, Jr., A. Wallace Tashima, and
          Consuelo M. Callahan, Circuit Judges.

                 Opinion by Judge Tashima




                            9117
                 SCOTTS COMPANY v. SEEDS, INC.              9119




                          COUNSEL

Colin Folawn, Schwabe, Williamson & Wyatt, Seattle, Wash-
ington, for the plaintiff-appellant.

Roger Sandberg, Esser & Sandberg, Pullman, Washington,
for defendant-appellee Seeds, Inc.

Peter C. Erbland, Paine Hamblen, Coer d’Alene, Idaho, for
defendants-appellees Millhorn Farms, Inc., Maple Leaf
Farms, Inc., Mica Creek, Inc., and Tim Freeburg.


                          OPINION

TASHIMA, Circuit Judge:

   Federal courts have broad authority to “look beyond the
pleadings, and arrange” — or realign — “the parties accord-
ing to their sides in the dispute.” City of Indianapolis v. Chase
Nat’l Bank of N.Y., 314 U.S. 63, 69 (1941) (internal quotation
marks omitted). We hold that when a federal court evaluates
9120               SCOTTS COMPANY v. SEEDS, INC.
realigning the parties in a case, it may not consider claims
made in a different case.

                                   I.

   In September 2007, The Scotts Company (“Scotts”) and
Seeds, Inc. (“Seeds”) entered into a Supply Agreement that
obligated Scotts to buy cleaned and processed Kentucky Blue-
grass seed from Seeds. The Supply Agreement allowed Scotts
to audit Seeds to ensure Seeds’ compliance with the terms of
the Agreement. Scotts, an Ohio LLC, brought a diversity
action against Seeds, a Washington corporation, in federal
district court for breach of this audit provision.1 Shortly after
Scotts filed its federal action, Millhorn Farms, Inc., Maple
Leaf Farms, Inc., Mica Creek, Inc., and Tim Freeburg
(“Growers”) sued Seeds and Scotts in Washington state court.
Maple Leaf Farms and Mica Creek are both Washington cor-
porations. Millhorn Farms is an Idaho corporation and Tim
Freeburg, a sole proprietor, is a citizen of Idaho. In their state
court complaint, the Growers alleged that in May 2008, Seeds
added an addendum to each of their contracts, in which Seeds
agreed to pay twenty cents per pound for Kentucky Bluegrass
seed above the original contract price. The Growers alleged
that Seeds failed to pay this additional twenty cents per pound
for the 2009 harvest and that Seeds did not make a scheduled
September 2010 payment. In its state court answer, Seeds
alleged that it had not paid the Growers because it had not
been paid by Scotts. Seeds also filed an amended cross-claim
against Scotts for breach of contract and unfair and deceptive
business practices.
  1
    Scotts entered into a similar Supply Agreement with Dye Seed Ranch,
Inc. (“Dye”) and brought a parallel action against Dye in district court.
The Scotts-Dye litigation proceeded in tandem with the Scotts-Seeds liti-
gation and the appeal in that case, No. 11-35234, was consolidated with
this case on appeal. Scotts and Dye voluntarily dismissed their dispute
before oral argument.
                 SCOTTS COMPANY v. SEEDS, INC.               9121
   After the Growers sued Seeds and Scotts in state court,
Seeds moved to dismiss this federal action under Federal Rule
of Civil Procedure Rule 12(b)(7), contending that the Growers
were indispensable parties. In response, Scotts filed an
Amended Complaint which added the Growers as defendants.
The Amended Complaint sought a declaration that the audit
is a condition precedent to Scotts’ payment to Seeds, specific
performance, and damages caused by Seeds’ breaches of con-
tract. It also sought a declaration that Scotts had not materi-
ally breached the Growers’ contracts and that the Growers
may not enforce the Supply Agreement. The Growers did not
answer the Amended Complaint.

   The Growers and Seeds moved the district court to realign
the Growers as plaintiffs and Seeds and Scotts as defendants.
Seeds also moved the court, in the alternative, to stay or dis-
miss the case in favor of the related state court proceedings.
The district court granted both motions. The realignment
stripped the district court of subject matter jurisdiction
because defendant Seeds was not diverse to all of the now-
plaintiff Growers. The district court alternatively held that it
would stay the federal proceedings in favor of the related state
court proceedings under either the Brillhart doctrine, Brillhart
v. Excess Ins. Co., 316 U.S. 491 (1942), or the Colorado
River doctrine, Colorado River Water Conservation Dist. v.
United States, 424 U.S. 800 (1976).

   Because the parties’ realignment resulted in the absence of
complete diversity of citizenship between defendant Seeds, on
the one hand, and newly-aligned plaintiffs-Growers, on the
other, the district court dismissed the action for lack of subject
matter jurisdiction under Rule 12(b)(1). Scotts timely
appealed.

                               II.

   A complaint’s alignment of the parties “is not binding on
the courts.” Dolch v. United Cal. Bank, 702 F.2d 178, 181
9122             SCOTTS COMPANY v. SEEDS, INC.
(9th Cir. 1983). Instead, “[w]e must align for jurisdictional
purposes those parties whose interests coincide respecting the
‘primary matter in dispute.’ ” Prudential Real Estate Affili-
ates, Inc. v. PPR Realty, Inc., 204 F.3d 867, 873 (9th Cir.
2000) (quoting Cont’l Airlines, Inc. v. Goodyear Tire & Rub-
ber Co., 819 F.2d 1519, 1523 (9th Cir. 1987)). “This inquiry
involves factual determinations of the type ordinarily left to
the district court and reviewed for clear error.” Id. at 872-73.

    The district court realigned the parties because it found that
Scotts’ audit claim “is ancillary to the primary dispute that
pits the Growers against Seeds . . . and in turn, against
Scotts.” After realignment, Washington citizens were on both
sides of the dispute; consequently, diversity jurisdiction was
destroyed. See 28 U.S.C. § 1332; Diaz v. Davis (In re Digi-
marc Corp. Derivative Litig.), 549 F.3d 1223, 1234 (9th Cir.
2008) (“Diversity jurisdiction requires complete diversity
. . . .”) (citing Strawbridge v. Curtiss, 7 U.S. (3 Cranch) 267,
267 (1806)).

   [1] In determining this “primary matter in dispute,” the
district court relied on claims made by the Growers in their
state court action. It explained that “[a]ll of the disputes in this
case . . . arise because the Growers have not been paid” and
that, because the “Growers are the ultimate recipients of the
funds at issue,” they are “most adversely affected by the dis-
pute.” But the Growers had not answered Scotts’ Amended
Complaint in federal court, and they sought the disputed funds
in state court. In response to Scotts’ objection on this ground,
the district court stated that “Scotts unduly narrows the scope
of the inquiry regarding what constitutes the ‘primary dispute’
by focusing narrowly on the ‘federal lawsuit.’ ” We hold that
this was error. When considering the primary purpose of a
federal case in a realignment inquiry, a court may not con-
sider claims made in a different case.

   This holding is consistent with our practice in past cases.
In Continental Airlines, we analyzed the principal purpose of
                 SCOTTS COMPANY v. SEEDS, INC.              9123
McDonnell Douglas’ federal declaratory judgment action
against Continental Airlines and three other defendants that
arose out of an airplane accident. 819 F.2d at 1523. In our
analysis, we did not consider the claims in a state court suit
arising out of the same accident that was brought by Conti-
nental Airlines against McDonnell Douglas and one of Conti-
nental Airlines’ federal co-defendants. See id. at 1523 n.2
(considering the principal purpose of McDonnell Douglas’
“federal suit”). Similarly, in Prudential Real Estate Affiliates,
we evaluated a defendant’s argument that her co-defendants
should be realigned as plaintiffs by considering the conflicts
among the parties with respect to the question presented in the
federal suit. 204 F.3d at 873-74. In our analysis, we did not
consider the claims made in a an ongoing related state suit
brought by the defendant who sought realignment against her
federal co-defendants. Id. The Third Circuit has also affirmed
realignment based on answers filed in federal court by the
realigned parties without considering arguments in related
state court litigation. See Emp’rs Ins. of Wausau v. Crown
Cork & Seal Co., 942 F.2d 862, 866 (3d Cir. 1991).

   This holding also avoids undermining the Colorado River
doctrine. Under Colorado River, 424 U.S. at 813, and a subse-
quent line of cases, see, e.g, Moses H. Cone Mem’l Hosp. v.
Mercury Constr. Corp., 460 U.S. 1, 19 (1983), a federal court
may stay a federal case in favor of a related state case only
in exceptional circumstances. “The federal district courts ordi-
narily must apply the test outlined in Colorado River . . . in
determining whether to stay federal proceedings in favor of
pending state court proceedings concerning the same subject
matter.” 40235 Wash. St. Corp. v. Lusardi, 976 F.2d 587, 588
(9th Cir. 1992). If a district court could consider claims in
related state cases in its primary purpose inquiry, such a flexi-
ble realignment doctrine could undermine the strict Colorado
River test.

  [2] The district court erred when it determined the primary
purpose of this federal lawsuit by considering the claims
9124                SCOTTS COMPANY v. SEEDS, INC.
made in a different lawsuit. On remand, should the district
court reconsider the realignment-of-parties issue, it should
limit its inquiry of what constitutes the primary dispute to the
primary purpose of this federal case.2

                                    III.

   A district court may, in its discretion, stay or dismiss a fed-
eral case in favor of related state proceedings: (1) when an
action seeks only declaratory relief, Wilton v. Seven Falls Co.,
515 U.S. 277, 282-88 (1995) (discussing Brillhart, 316 U.S.
at 494-95), or (2) when exceptional circumstances exist,
Moses H. Cone, 460 U.S. at 14 (quoting Colorado River, 424
U.S. at 813). The district court in this case held that if it were
not dismissing the case for lack of subject matter jurisdiction,
it would stay the case pending resolution in state court for
either reason.

  We review both rulings for abuse of discretion. See Wilton,
515 U.S. at 289; Travelers Indem. Co. v. Madonna, 914 F.2d
1364, 1367 (9th Cir. 1990). We hold that the district court
abused its discretion.

                                    A.

   [3] A district court may, in its discretion, decline to hear a
declaratory judgment action when a related case is pending in
state court. Wilton, 515 U.S. at 289. But this discretionary
jurisdictional rule does not apply to “[c]laims that exist inde-
pendent of the request for a declaration.” Snodgrass v. Provi-
dent Life & Accident Ins. Co., 147 F.3d 1163, 1167 (9th Cir.
1998). These “independent” claims are instead evaluated
  2
    Scotts also argues that the district court’s consideration of the claims
in the state court proceedings was erroneous because the state court case
was commenced after the federal case. Because we hold that, in this case,
the district court erred in considering the state court claims at all, we need
not separately consider Scotts’ later-in-time argument.
                 SCOTTS COMPANY v. SEEDS, INC.                9125
under the Colorado River doctrine. Id. In this context, a claim
is independent if it “would continue to exist if the request for
a declaration simply dropped from the case.” Id. at 1168; see
also United Nat’l Ins. Co. v. R&D Latex Corp., 242 F.3d
1102, 1113 (9th Cir. 2001).

   [4] Scotts seeks both declaratory and non-declaratory relief
in its Amended Complaint. Therefore, the district court was
correct to evaluate whether Scotts’ non-declaratory claim is
independent of its declaratory claim. The district court cor-
rectly stated the independence rule, but it did not correctly
apply that rule in its analysis. Instead, the district court ana-
lyzed whether the two sets of claims contained overlapping
facts: it found that the request for an audit is the “driving
force behind all other issues” and that Scotts will have a basis
for its non-declaratory claims “[o]nly if that audit shows some
improprieties.” This approach is incorrect. See United Nat’l
Ins. Co., 242 F.3d at 1112 (“It appears the district court
believed that, for purposes of this analysis, two claims are
‘independent of’ one another only if one can be resolved with-
out disposing of the legal issues raised in the other . . . . We
do not believe this is the proper analysis.”). The district court
abused its discretion when it applied the incorrect rule. See
Casey v. Albertson’s Inc., 362 F.3d 1254, 1257 (9th Cir.
2004).

   [5] Scotts’ damages claim is independent because it would
be viable without the declaratory claim. Snodgrass, 147 F.3d
at 1168. “[W]hen other claims are joined with an action for
declaratory relief . . . , the district court should not, as a gen-
eral rule, remand or decline to entertain the claim for declara-
tory relief.” Gov’t Emps. Ins. Co. v. Dizol, 133 F.3d 1220,
1225 (9th Cir. 1998) (en banc) (citation omitted). Therefore,
the district court should not have declined to entertain the
claim for declaratory relief under the Brillhart doctrine.
Instead, these claims should have been evaluated under the
Colorado River doctrine.
9126             SCOTTS COMPANY v. SEEDS, INC.
                               B.

   Exceptional circumstances must be present for a district
court to abstain from Scotts’ independent non-declaratory
judgment claim and its related declaratory judgment claims.
Colorado River, 424 U.S. at 813; also Moses H. Cone, 460
U.S. at 16 (“[T]he decision whether to dismiss a federal action
because of parallel state-court litigation does not rest on a
mechanical checklist, but on a careful balancing of the impor-
tant factors as they apply in a given case, with the balance
heavily weighted in favor of the exercise of jurisdiction.”).

   [6] In analyzing whether Colorado River applies, the dis-
trict court stated that “[n]o showing of ‘exceptional circum-
stances’ is required to support a decision to abstain from
hearing a declaratory relief action.” The district court pro-
ceeded to consider the Colorado River factors without explic-
itly finding that exceptional circumstances were present. The
district court abused its discretion because it failed to find
exceptional circumstances before declining to exercise its
jurisdiction. See Am. Int’l Underwriters (Philippines), Inc. v.
Cont’l Ins. Co., 843 F.2d 1253, 1256 (9th Cir. 1988) (“[T]he
district court judge in this case must have exercised discretion
within the ‘exceptional circumstances’ limits of the Colorado
River abstention doctrine.”). On remand, the district court
shall consider whether exceptional circumstances exist that
would justify declining to exercise its jurisdiction.

                              IV.

   The judgment of the district court dismissing the case for
lack of subject-matter jurisdiction is reversed and remanded
for further proceedings. On remand, the district court may
consider whether the parties should be realigned by evaluating
the parties’ interests with respect to the primary purpose of
this case. If the district court reconsiders possible abstention,
it should first determine whether exceptional circumstances
exist under the Colorado River test, which would justify
                 SCOTTS COMPANY v. SEEDS, INC.              9127
declining to exercise its jurisdiction over this case. If it does
not find the requisite exceptional circumstances, it shall pro-
ceed to hear the merits of this case.

  REVERSED and REMANDED.
