
4 So.3d 1092 (2008)
Ex parte J.C. DUKE & ASSOCIATES, INC.
(In re DelZak Builders, Inc. v. J.C. Duke & Associates, Inc., and Arch Insurance Company).
1070298.
Supreme Court of Alabama.
August 22, 2008.
*1093 C. William Daniels, Jr., Keith S. Rivers, and Ricardo A. Woods of Bowron, Latta & Wasden, P.C., Mobile, for petitioner.
Michael Gillion, Mobile, for respondent.
PARKER, Justice.
J.C. Duke & Associates, Inc. ("Duke"), petitions this Court for a writ of mandamus ordering the trial court to vacate its order denying Duke's motion to dismiss the claims against it pursuant to Ala.Code 1975, § 6-5-440, Alabama's abatement statute. We grant the petition and issue the writ.

I. Facts and Procedural Posture
In February 2005, Duke sued C.L. Roofing Professionals, Inc., and DelZak Builders, Inc., in the Mobile Circuit Court, alleging poor workmanship, untimely performance, and breach of warranty. Duke's claims arise out of its contract with DelZak for the installation of a roof on a Merchants Bank building in Jackson, located in Clarke County. DelZak and its related company, C.L. Roofing, filed an answer and counterclaim in April 2005; they did not object to venue or jurisdiction. The counterclaim alleged that Duke owed DelZak and C.L. Roofing $250,000 for labor and materials for previous jobs DelZak had completed for Duke in Mobile County; that Duke lied about its intent to pay the amount DelZak claimed was owed; and that Duke had committed fraud, misrepresentation, and coercion in its dealings with DelZak and C.L. Roofing. In addition, DelZak and C.L. Roofing alleged that Duke had slandered the companies and their employees. The counterclaim, in part, stated:
"Duke attempted to coerce DelZak into performing work on [a Mobile County project] by withholding funds and money directly and justly due from other projects. When [DelZak and C.L. Roofing] explained to J.C. Duke that the intervention of hurricanes and tropical storms had doubled or quadrupled the cost of materials, J.C. Duke slandered [Delzak and C.L. Roofing] and their employees by stating of and concerning [DelZak and C.L. Roofing] and their employees that they were not good roofers, and did not perform good work. J.C. Duke, his company, and/or his agents, servants, and/or employees published of and concerning [DelZak and C.L. Roofing] that one or more of them was `the sorriest roofer in Mobile County.' This statement was made after J.C. Duke refused to pay monies justly due to [DelZak and C.L. Roofing], and after [DelZak and C.L. Roofing] refused to do any further work for J.C. Duke until he paid all past due accounts."
Petition, Appendix 2, at unmarked 5.
On October 2, 2006, DelZak sued Duke in Clarke County, basing its complaint on the contract for roofing the Merchants Bank building in Clarke County. DelZak contended that it was due funds for work and labor done and damages for, among other things, breach of contract and fraud as well as recovery under a theory of quantum meruit. On January 3, 2007, Duke moved to dismiss the action based on § 6-5-440, Ala.Code 1975, sometimes referred to as the abatement statute. DelZak did not file a response to the motion to dismiss. On October 18, 2007, the Clarke Circuit Court issued an order denying Duke's motion to dismiss.

II. Standard of Review
"A writ of mandamus is a
"`drastic and extraordinary writ, to be issued only where there is: (1) a clear legal right in the petitioner 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 *1094 adequate remedy; and (4) properly invoked jurisdiction of the court.'"
Ex parte Wood, 852 So.2d 705, 708 (Ala. 2002) (quoting Ex parte United Serv. Stations, Inc., 628 So.2d 501, 503 (Ala.1993)).

III. Analysis
Duke contends that unless this Court issues a writ of mandamus directing the Clarke Circuit Court to dismiss the action filed there by DelZak, it faces the expense of litigating two actions and the possibility of inconsistent verdicts or adverse judgments. It maintains that both the complaint filed in the Mobile Circuit Court and the lawsuit filed in the Clarke Circuit Court state claims that arise out of the same construction projectroofing the Merchants Bank building in Clarke County. Petition at 2.
The abatement statute provides:
"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."
§ 6-5-440, Ala.Code 1975. A question presented to determine whether a party has run afoul of § 6-5-440 is whether the claim presented in the second action is a compulsory counterclaim in the first action. "[A] compulsory counterclaim is considered an `action' for purposes of § 6-5-440." Ex parte Norfolk Southern Ry., 992 So.2d 1286, 1289 (Ala.2008). "Under the logical-relationship test `[a] counterclaim is compulsory if there is any logical relation of any sort between the original claim and the counterclaim.' Committee Comments on the 1973 adoption of Rule 13, ¶ 6." Bedsole v. Goodloe, 912 So.2d 508, 521 (Ala.2005).
In Ex parte Breman Lake View Resort, L.P., 729 So.2d 849, 851 (Ala.1999), this Court applied the abatement statute in a case where the issue involved was whether the claim asserted in a subsequent action was a compulsory counterclaim in the first-filed action:
"[T]he obligation imposed on a defendant under Rule 13(a), Ala. R. Civ. P., to assert compulsory counterclaims, 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. We affirm the general rule expressed in these cases; to do otherwise would invite waste of scarce judicial resources and promote piecemeal litigation."
The complaint filed by DelZak in Clarke County involves the construction agreement between Duke and DelZak regarding the Merchants Bank project. This is the same dispute that gave rise to the action filed by Duke in Mobile County, to which DelZak has filed an answer and counterclaim. There is a readily apparent logical relationship between Duke's original complaint and DelZak's counterclaim; thus DelZak's counterclaim was a compulsory *1095 one. Venue is not at issue in the action pending in Mobile County because DelZak did not challenge venue in Mobile County when it filed its responsive pleading to Duke's complaint; thus DelZak has waived any potential affirmative defense of improper venue. Rule 12(h)(1), Ala. R. Civ. P.
In its complaint filed in Clarke County, DelZak also named as a defendant Arch Insurance Company, which was Duke's payment and performance bond company. DelZak did not name Arch Insurance in its counterclaim in the Mobile County action. DelZak appears to argue that because it named Arch Insurance as a defendant in the Clarke County action, the claims asserted in the Clarke County action are not compulsory counterclaims in the Mobile County action.
"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."
Rule 13(a), Ala. R. Civ. P. (emphasis added). However, DelZak presents no authority to support its proposition; it merely quotes Rule 13(a). DelZak does not explain how or why the Mobile Circuit Court could not acquire jurisdiction over Duke's surety, Arch Insurance.
Pursuant to § 6-5-440, Ala.Code 1975, and this Court's decision in Breman Lake View Resort, L.P., supra, DelZak's action in Clarke County must be abated in favor of the Mobile County action, in which DelZak has already filed its compulsory counterclaim.

IV. Conclusion
Duke has met the requirements for the issuance of the writ. Accordingly, we order the Clarke Circuit Court to dismiss DelZak's complaint.
PETITION GRANTED; WRIT ISSUED.
COBB, C.J., and SEE and SMITH, JJ., concur.
WOODALL, J., concurs in the result.
