Dale W. Dozier (“the former husband”) petitions this court for a writ of mandamus directing the Russell Circuit Court to dismiss, pursuant to Ala.Code 1975, § 6-5-440, the contempt petition filed in that court by Diane L. Dozier (“the former wife”). We grant the former husband’s petition and issue the writ.
The former husband and the former wife were divorced by a judgment of *675the Russell Circuit Court entered in February 2010. The divorce judgment ordered the former husband to pay periodic alimony to the former wife. On October 8, 2013, the former husband filed a petition in the Lee Circuit Court in which he sought the termination of his periodic-alimony obligation based on his allegation that the former wife had been cohabiting with a member of the opposite sex in Lee County; in the alternative, he sought a modification of his periodic-alimony obligation. See Ala.Code 1975, § 30-2-55 (requiring that periodic alimony terminate when the payor spouse proves that the payee spouse has remarried or is cohabiting with a member of the opposite sex); Ex parte Ward, 782 So.2d 1285, 1288 (Ala.2000) (quoting Russell v. Russell, 586 So.2d 12, 13 (Ala.Civ.App.1991)) (noting that “ ‘no [periodic] alimony accrues or matures beyond the time that ... cohabitation began’ ”); Rose v. Rose, 70 So.3d 429, 435 (Ala.Civ.App.2011) (noting that a “trial court is required to terminate payment of [periodic alimony] as of the time cohabitation begins”). The former wife, who, according to the materials before this court, resides in Lee County, was served with the former husband’s petition on August 22, 2014.1 Seven days later, on August 29, 2014, the former wife, acting pro se, filed in the Russell Circuit Court a petition seeking to hold the former husband in contempt for failing to pay periodic alimony; apparently, the former husband had unilaterally decided to stop paying that obligation. The former husband filed a motion to dismiss the former wife’s petition, which the Russell Circuit Court denied on September 30, 2014. The former husband timely filed this petition for the writ of mandamus with this court.
“A writ of mandamus is an extraordinary remedy, and it will be ‘issued only when 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 adequate remedy; and 4) properly invoked jurisdiction of the court.’ Ex parte United Serv. Stations, Inc., 628 So.2d 501, 503 (Ala.1993). A writ of mandamus will issue only to compel the exercise of a trial court’s discretion; it will not issue to control or to review a court’s exercise of its discretion unless an abuse of discretion is shown. Ex parte Auto-Owners Ins. Co., 548 So.2d 1029 (Ala.1989).”
Ex parte Breman Lake View Resort, L.P., 729 So.2d 849, 851 (Ala.1999).
As he did in his motion to dismiss filed in the Russell Circuit Court, the former husband argues in his mandamus petition that the former wife’s petition for contempt is due to- be dismissed because, he asserts: (1) that, under Rule 13(a), Ala. R. Civ. P., the former wife’s claim of contempt is a compulsory counterclaim to his claims seeking the termination or modification of his periodic-alimony obligation and, thus, (2) that, pursuant to § 6-5-440, which prohibits the prosecution of two actions for the same cause against the same party, the former wife is barred from pursuing her contempt claim as an independent action in the Russell Circuit Court rather than as a compulsory counterclaim in the Lee Circuit Court.
*676In order to be entitled to the writ of mandamus he seeks, the former husband must first establish that the former wife’s petition seeking to hold him in contempt for failing to pay periodic alimony raises what is a compulsory counterclaim to his claims seeking the termination or modification of his periodic-alimony obligation. As our supreme court has explained, “Rule 13(a), Ala. R. Civ. P., ... require[s] a party to file as a counterclaim ‘any claim ... the pleader has against any opposing party’ that arises out of the same transaction or occurrence involved in the opposing party’s claim.” Ex parte Canal Ins. Co., 534 So.2d 582, 584 (Ala.1988).
“The Committee Comments to Rule 13(a) state: ‘A counterclaim is compulsory if there is any logical relation of any sort between the original claim and the counterclaim.’ .... In Brooks v. Peoples National Bank, 414 So.2d 917, 919 (Ala.1982), this Court explained:
“ ‘The logical relationship test denominates a counterclaim as compulsory if (1) its trial in the original action would avoid substantial duplication of effort or (2) the original claim and the counterclaim arose out of the same aggregate core of operative facts. The claims arise from the same core of operative facts if (1) the facts taken as a whole serve as the basis for both claims or (2) the sum total of facts upon which the original claim rests creates legal rights in a party which would otherwise remain dormant.’
“.... This Court has further stated that ‘ “[t]he rule on compulsory counterclaims should receive a ‘broad realistic interpretation in light of the interest of avoiding a multiplicity of suits.’ ” ’ Mississippi Valley Title Ins. Co. v. Hardy, 541 So.2d 1057, 1060 (Ala.1989) (quoting Plant v. Blazer Fin. Services, Inc. of Georgia, 598 F.2d 1357, 1361 (5th Cir. 1979)) (quoting 3 Moore’s Federal Practice ¶ 13.13 at p. 300).”
Ex parte Water Works & Sewer Bd. of Birmingham, 738 So.2d 783, 789 (Ala.1998).
This court has noted that, even when termination of periodic alimony is warranted because of cohabitation by the payee spouse, the unilateral decision by the payor spouse to withhold payment before seeking a modification of his or her periodic-alimony obligation may form the basis of a contempt determination. Rose, 70 So.3d at 435. A comparison of the former husband’s petition seeking the termination or modification of his periodic-alimony obligation and the former wife’s petition for contempt indicates that the former husband’s and the former wife’s claims clearly arise from the same core of operative facts — the facts surrounding the propriety of the continuation of the former husband’s periodic-alimony obligation and his decision to unilaterally stop paying that obligation. Just as clearly, we conclude that “ ‘the facts taken as a whole serve as the basis for [the former husband’s and the former wife’s] claims.’ ” Ex parte Water Works & Sewer Bd., 738 So.2d at 789 (quoting Brooks v. Peoples Nat’l Bank, 414 So.2d 917, 919 (Ala.1982)). Thus, we agree with the former husband that the former wife’s claim seeking to hold him in contempt for failing to pay periodic alimony is a compulsory counterclaim to his claims seeking a termination or modification of his periodic-alimony obligation.
Because we have concluded that the former wife’s petition states a compulsory counterclaim to the former husband’s claims, we must now consider whether § 6-5-440 requires dismissal of the former wife’s contempt petition. Our supreme court
“has held that the obligation imposed on a defendant under Rule 13(a), Ala. R. *677Civ. P., to assert compulsory counterclaims, when read in conjunction with § 6-5^140, 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.”
Ex parte Breman Lake View Resort, 729 So.2d at 851. Based on the law set out in Ex parte Breman Lake View Resort, the former wife was required to assert her claim for contempt in the Lee Circuit Court, because the contempt claim is a compulsory counterclaim to the former husband’s claims in the action pending in that court, and her instigation of a separate action in Russell Circuit Court runs afoul of § 6-5-440.
The former husband has met the requirements for the issuance of a writ of mandamus, including demonstrating a clear legal right to the relief he seeks; therefore, we grant his petition. The Russell Circuit Court is directed to enter an order dismissing the former wife’s contempt petition.
PETITION GRANTED; WRIT ISSUED.
PITTMAN, MOORE, and DONALDSON, JJ., concur. THOMPSON, P.J., concurs in the result, without writing.. In her answer to the former husband’s petition for the writ of mandamus, the former wife does not refute the factual assertions in the former husband’s petition, so we accept those assertions as true. See Ex parte Turner, 840 So.2d 132, 134-35 (Ala.2002) (holding that when a respondent fails to challenge factual allegations contained in a petition for the writ of mandamus, the appellate court accepts as true the factual statements in the ■petition).