
992 So.2d 1286 (2008)
Ex parte NORFOLK SOUTHERN RAILWAY COMPANY, Norfolk Southern Corporation, and John D. Summers.
(In re Dexter A. Grandison
v.
Norfolk Southern Railway Company et al.).
1060374.
Supreme Court of Alabama.
April 25, 2008.
*1287 Crawford S. McGivaren, Jr., Steve A. Tucker, R. Boyd Miller, and John M. Graham of Cabaniss, Johnston, Gardner, Dumas & O'Neal, LLP, Birmingham, for petitioners.
W. Lee Pittman and Joel F. Alexander III of Pittman, Dutton, Kirby & Hellums, P.C., Birmingham, for respondent Dexter A. Grandison.
William H. Webster, D. Mitchell Henry, and Mark E. Irby of Webster, Henry, Lyons & White, P.C., Montgomery, for respondents Ronny Pyrell Johnson, Gail Rolison, Rolison Trucking Co., and Kim Johnson; J. Jefferson Utsey of Utsey & Utsey, Butler, for respondents Gail Rolison and Rolison Trucking Co.; and J. Michael Comer of Patterson & Comer, LLC, Tuscaloosa, for respondents Ronny Pyrell Johnson.
*1288 SMITH, Justice.
Norfolk Southern Railway Company ("NSRC"), Norfolk Southern Corporation ("Norfolk Southern"), and John D. Summers (collectively "the petitioners") petition for a writ of mandamus directing the trial court to dismiss, pursuant to Ala.Code 1975, § 6-5-440, the claims asserted against them in the Clarke Circuit Court by codefendants Rolison Trucking Company, LLC ("Rolison Trucking"); Gail Rolison; Ronny Johnson; and Kim Johnson. We deny the petition.

Facts and Procedural History
In February 2005, a train operated by NSRC and two NSRC employeesDexter A. Grandison, a conductor, and Summers, a locomotive engineercollided with a truck at a railroad crossing in Clarke County. Ronny Johnson was driving the truck for his employer, Rolison Trucking.
On April 12, 2006, Grandison filed an action in the Clarke Circuit Court seeking damages for injuries he allegedly suffered in the accident (hereinafter "the Clarke County action"). Grandison sought damages from NSRC under the Federal Employers' Liability Act, 45 U.S.C. § 51 et seq. He also alleged state-law claims seeking damages against Rolison Trucking and Ronny Johnson for negligence and wantonness. Gail Rolison, the sole member of Rolison Trucking and the owner of the truck, was later added as a defendant.
On May 9, 2006, NSRC sued Rolison Trucking, Gail Rolison, and Ronny Johnson in the United States District Court for the Southern District of Alabama, Southern Division, seeking damages for negligence and wantonness. Specifically, NSRC contended that Johnson negligently or wantonly caused the collision and damaged NSRC's train.
On May 26, 2006, Johnson, Rolison Trucking, and Gail Rolison all filed separate answers to Grandison's complaint in the Clarke County action. Additionally, they asserted what they called "cross-claims" against NSRC, seeking damages for negligence, wantonness, and for violation of Ala.Code 1975, § 37-2-81. They further alleged "third-party" claims against Summers, NSRC, and Norfolk Southern (NSRC's parent corporation) and asserted counterclaims against Grandison. Also on that date, Kim Johnson, Ronny Johnson's wife, filed both a motion to intervene and a complaint, which sought damages against Grandison, NSRC, Norfolk Southern, and Summers for loss of consortium. The trial court later granted Kim Johnson's motion to intervene. Ronny Johnson, Kim Johnson, Rolison Trucking, and Gail Rolison later amended the pleadings to allege that their claims against Summers, NSRC, and Norfolk Southern had been erroneously characterized as third-party claims and were actually cross-claims under Rule 13(h), Ala. R. Civ. P.
Subsequently, NSRC filed a motion in the Clarke County action contending that Ala.Code 1975, § 6-5-440, required the trial court to dismiss the claims filed against it by the Johnsons, Rolison, and Rolison Trucking because the federal court action had been filed before those claims were filed and thus took precedence over the subsequently filed claims in the Clarke County action.[1] NSRC further argued that the claims the Johnsons, Rolison, and Rolison Trucking were attempting to assert as "cross-claims" were actually compulsory *1289 counterclaims that must be asserted in the federal court action.
In the meantime, Ronny Johnson, Rolison, and Rolison Trucking moved the federal district court to stay the case under the abstention doctrine found in Colorado River Water Conservation District v. United States, 424 U.S. 800, 96 S.Ct. 1236, 47 L.Ed.2d 483 (1976). Under the Colorado River abstention doctrine, a federal court stays an action when there is an ongoing parallel action in a state court. Moorer v. Demopolis Waterworks & Sewer Bd., 374 F.3d 994, 997 (11th Cir.2004). In determining whether a stay is warranted, the court balances its obligation to exercise jurisdiction over factors counseling against exercising that jurisdiction. See Moorer, 374 F.3d at 997-98. The federal district court, after weighing various factors, found that the potential for excessive and inconsistent piecemeal litigation outweighed the factors in favor of litigating NSRC's federal court action. Thus, the federal district court found that the Colorado River doctrine required that it abstain from proceeding with the case and entered a stay.
The Clarke Circuit Court held a hearing on the motion to dismiss and on November 28, 2006, issued an order denying the motion. NSRC, Norfolk Southern, and Summers then petitioned this Court for mandamus relief.

Standard of Review
A writ of mandamus is appropriate when the petitioner can demonstrate "(1) a clear legal right to the order sought; (2) an imperative duty upon the respondent to perform, accompanied by a refusal to do so; (3) the lack of another adequate remedy; and (4) the properly invoked jurisdiction of the court." Ex parte BOC Group, Inc., 823 So.2d 1270, 1272 (Ala.2001).

Discussion
The petitioners contend that the "cross-claims" filed by the Johnsons, Rolison, and Rolison Trucking in the Clarke County action must be dismissed pursuant to Ala.Code 1975, § 6-5-440, which generally prohibits a plaintiff from maintaining duplicate actions:
"No plaintiff is entitled to prosecute two actions in the courts of this state at the same time for the same cause and against the same party. In such a case, the defendant may require the plaintiff to elect which he will prosecute, if commenced simultaneously, and the pendency of the former is a good defense to the latter if commenced at different times."
This Code section, by its plain language, forbids a party from prosecuting two actions for the "same cause" and against the "same party." This Court has previously held that an action pending in a federal court falls within the coverage of this Code section:
"`The phrase "courts of this state," as used in § 6-5-440, includes all federal courts located in Alabama. This Court has consistently refused to allow a person to prosecute an action in a state court while another action on the same cause and against the same parties is pending in a federal court in this State.'"
Ex parte University of South Alabama Found., 788 So.2d 161, 164 (Ala.2000) (quoting Weaver v. Hood, 577 So.2d 440, 442 (Ala.1991) (citations in Weaver omitted in University of South Alabama)). Additionally, a compulsory counterclaim is considered an "action" for purposes of § 6-5-440. Penick v. Cado Sys. of Cent. Alabama, Inc., 628 So.2d 598, 599 (Ala.1993). As this Court has noted:
"This Court has held that the obligation... to assert compulsory counterclaims, *1290 when read in conjunction with § 6-5-440, Ala.Code 1975, which prohibits a party from prosecuting two actions for the same cause and against the same party, is tantamount to making the defendant with a compulsory counterclaim in the first action a `plaintiff' in that action (for purposes of § 6-5-440) as of the time of its commencement. See, e.g., Ex parte Parsons & Whittemore Alabama Pine Constr. Corp., 658 So.2d 414 (Ala.1995); Penick v. Cado Systems of Cent. Alabama, Inc., 628 So.2d 598 (Ala.1993); Ex parte Canal Ins. Co., 534 So.2d 582 (Ala.1988). Thus, the defendant subject to the counterclaim rule who commences another action has violated the prohibition in § 6-5-440 against maintaining two actions for the same cause."
Ex parte Breman Lake View Resort, L.P., 729 So.2d 849, 851 (Ala.1999). See also University of South Alabama Found., 788 So.2d at 165 (holding that a party in an action pending in a federal court was subject to the counterclaim rule and thus violated § 6-5-440 by commencing another action in a state court); Ex parte Parsons & Whittemore Alabama Pine Constr. Corp., 658 So.2d 414 (Ala.1995) (holding that the prosecution in a subsequent action of claims that had been compulsory counterclaims in a previously filed declaratory-judgment action violated § 6-5-440).
The petitioners argue that the claims alleged against NSRC by the Johnsons, Rolison, and Rolison Trucking in the Clarke County action "are compulsory counterclaims which should be asserted (if at all) in the federal court lawsuit," which was filed over two weeks before the Johnsons, Rolison, and Rolison Trucking filed their claims in the Clarke County action. Under § 6-5-440, the petitioners argue, the Johnsons, Rolison, and Rolison Trucking can maintain their claims only in the federal action (where those claims asserted in the Clarke County action would be compulsory counterclaims), which was filed first. We disagree.
Since this petition was filed, NSRC appealed the federal district court's decision to stay the case to the United States Court of Appeals for the Eleventh Circuit. In an order dated May 22, 2007, the Eleventh Circuit affirmed the decision of the federal district court, Norfolk Southern Railway v. Rolison Trucking Co., No. 06-15314, 225 Fed.Appx. 840 (May 22, 2007, 11th Cir. 2007), and NSRC's petition for a rehearing was denied. Thus, the district court's decision to stay the case under the abstention doctrine of Colorado River remains intact.
In Terrell v. City of Bessemer, 406 So.2d 337 (Ala.1981), this Court recognized an exception to § 6-5-440 that, by analogy, is applicable in this case. It discussed that exception in University of South Alabama Foundation, 788 So.2d at 165:
"In Terrell, this Court recognized a limited exception to the general rule against prosecuting the same cause of action in two different courts, noting that where a single wrongful act gives rise to both a state cause of action and a federal cause of action, the plaintiff may include his state-law claim with his federal claim and request the court to exercise its power of pendent jurisdiction to hear both claims. Terrell, 406 So.2d at 339-40. The plaintiff in Terrell included his state-law claims with his federal-law claims; however, the federal district court refused to exercise its discretionary power of pendent jurisdiction. This Court concluded that in a situation where the plaintiff has combined state-law claims with federal claims in an action filed in a federal court and the federal court declines to exercise its discretionary power of pendent jurisdiction *1291 over the state-law claims, the plaintiff `should be afforded an opportunity to pursue his alleged common law theories of recovery in state court.' 406 So.2d at 339."
In the instant case, the federal district court exercised its power under Colorado River to stay the action pending in that court. NSRC attempted, but failed, to have the Eleventh Circuit Court of Appeals dissolve that stay. For all practical purposes, the federal district court has declined to hear NSRC's claims. If this Court were to halt the Clarke County action pursuant to § 6-5-440, then this case would present the absurd result the Terrell exception was crafted to prevent: the respondents would have no forum in which to present their claims. We thus hold that, when a federal court abstains from hearing a case under the Colorado River doctrine, that case is not considered as an action being prosecuted, for purposes of § 6-5-440.
Because the petitioners have not demonstrated that § 6-5-440 is applicable in this case and because an exception to the Code section applies, the petitioners have not demonstrated a clear legal right to relief they seek.[2] Therefore, the petition is denied.
PETITION DENIED.
COBB, C.J., and SEE, LYONS, WOODALL, STUART, BOLIN, PARKER, and MURDOCK, JJ., concur.
NOTES
[1]  Summers and Norfolk Southern did not join NSRC's motion to dismiss; instead, they filed a separate motion to dismiss contending that the "third-party" claims filed against them by the Johnsons, Rolison, and Rolison Trucking were improper under Rule 14, Ala. R. Civ. P.
[2]  The petitioners also allege that, because the claims asserted by the Johnsons, Gail Rolison, and Rolison Trucking against NSRC are due to be dismissed under § 6-5-440, then their claims against Norfolk Southern and Summers are also due to be dismissed. However, because NSRC's § 6-5-440 argument is without merit, this allegation is without merit as well.
