
985 So.2d 404 (2007)
Ex parte Sarah Hicks STEWART and Sarah Hicks Stewart, P.C.
(In re Furth, Fahrner & Mason, P.C., et al.
v.
Rayford L. Etherton et al.).
1060628.
Supreme Court of Alabama.
November 2, 2007.
*405 Steven L. Nicholas of Olen, Nicholas & Copeland, P.C., Mobile, for petitioner.
Earl V. Johnson, Andalusia, for respondents.
BOLIN, Justice.
Sarah Hicks Stewart and Sarah Hicks Stewart, P.C. (hereinafter collectively referred to as "Stewart"), petition this Court for a writ of mandamus directing the trial court to enter a summary judgment in favor of Stewart because, Stewart argues, the trial court lacks subject-matter jurisdiction over a dispute involving the distribution of an attorney-fee award.

Facts and Procedural History
On September 11, 1996, members of a class who owned interests in oil wells filed a class action in the Escambia Circuit Court against several major oil companies who had purchased oil from the wells in which the class members had an interest. Lovelace v. Amerada Hess Corp. (CV-96-297). The class members alleged that the oil companies had conspired to fix the price of crude oil in violation of the antitrust laws of various states, and they sought certification of a national class. Rayford Etherton, Michael Fincher, and William Stokes were designated as lead counsel for the class.
In 1997, one of the oil companies, Mobil Oil Corporation, entered into settlement negotiations with the class members. The negotiations resulted in a settlement of $15,000,000 for the underpayment of royalties and working interests. The settlement agreement also provided that Mobil would make payments in the future to its private royalty and working-interest owners in a different manner, which would result in a benefit to the class members. The present value to the class members of the prospective relief was between $19,464,000 and $35,800,000.
On April 10, 1997, several of the attorneys for the class members involved in the Lovelace litigation met in New Orleans. Included in their discussions was a discussion regarding managing the case. Sarah Stewart memorialized the discussions from that meeting.
On May 14, 1997, the circuit court preliminarily approved the settlement with Mobil. Following preliminary approval of the settlement and distribution of class notice, the court conducted a fairness hearing. *406 On October 3, 1997, lead class counsel filed a motion to approve attorney fees. On October 6, 1997, the court held a hearing regarding attorney fees.
On December 12, 1997, the circuit court entered a final judgment approving the settlement and the attorney fees and dismissing Mobil with prejudice. With regard to attorney fees, the circuit court addressed the factors set forth in Peebles v. Miley, 439 So.2d 137 (Ala.1983), to guide courts in determining reasonable attorney fees in class-action lawsuits. The court approved an award of attorney fees in the amount of $6,580,000 to lead class counsel. The circuit court's order provided, in pertinent part, as follows:
"Without affecting the finality of this Final Judgment in any way, the Court reserves exclusive and continuing jurisdiction over the Class Action, the Class Representatives, the Class, and Mobil for the purposes of (a) supervising the implementation, enforcement, construction and interpretation of the Settlement Agreement, the Preliminary Approval Order, and the Final Judgment; (b) hearing and determining any application by the Class Representatives and Class Counsel for an award of attorneys' fees, costs, and expenses; (c) hearing and determining whether the proposed Plan of Allocation is fair, reasonable, and adequate to the eligible Class Members pursuant to Rule 23 of the Alabama Rules of Civil Procedure; (d) supervising the administration and distribution of the Settlement Fund and the Continuing Litigation Fund; and (e) enforcing the Final Judgment."
According to Stewart's brief, following the December 12, 1997, judgment, several appeals were filed by class members who objected to the terms of the settlement agreement.[1] According to Stewart, this Court dismissed those pending appeals on March 12, 1998. Subsequently, lead class counsel allocated the attorney fees among the law firms involved and provided reimbursement checks to those law firms who had provided funds for expenses.
On August 8, 1998, several of the out-of-state law firms filed a motion entitled "Motion to Repay and Reallocate Attorneys' fees or, in the Alternative, to order mediation" in the Lovelace litigation (case no. CV-96-297). Included in the out-of-state law firms dissatisfied with the apportionment of the attorney fees was Stokes's law firm. In their motion, the law firms claimed that the disbursement of attorney fees from the settlement was done without court approval, and they asked the circuit court to resolve the fee dispute or, in the alternative, to order mediation of the fee dispute.
According to Stewart's brief, in response, Etherton, Fincher, and Stewart filed a motion to compel arbitration and a motion to dismiss the law firms' motion. Neither of those motions is included in the appendix to Stewart's petition.
The circuit court held a hearing on February 3, 1999, and another hearing on March 16, 1999. The transcript from the March 16, 1999, hearing is included in the appendix to Stewart's petition. The circuit court took several matters under advisement and asked the parties to submit additional authority. The court never ruled on any of the pending motions in case no. CV-96-297. According to Stewart's petition, the remaining oil companies were dismissed on April 19, 2002.
*407 On October 26, 1999, several of the out-of-state law firms[2] filed a separate action in the Escambia Circuit Court naming the following as defendants: Etherton; Etherton Smith, Etherton's law firm; Fincher; Michael Fincher, P.C.; Scott A. Powell; Hare, Wynn, Newell and Newton, P.C.; Sarah Stewart; and Sarah Stewart, P.C. Their complaint was designated as case no. CV-99-338. In their complaint, they alleged unjust enrichment, quantum meruit, and legal malpractice against all the defendants. The law firms claimed that Stewart had breached a contract regarding how attorneys fees were to be distributed. Additional claims were filed against Etherton and Fincher as lead class counsel.
According to Stewart, no discovery has occurred in case no. CV-99-338. In 2006, Stewart filed a motion for a summary judgment, arguing, among other things, that the trial court lacked jurisdiction over the complaint filed in CV-99-338 and that the lawsuit is an impermissible collateral attack on the jurisdiction of the court in the Lovelace litigation (case no. CV-96-297). The trial court denied Stewart's motion for a summary judgment. On January 24, 2007, Stewart filed her petition for a writ of mandamus with this Court.

Standard of Review
"This Court's standard of review applicable to a petition for a writ of mandamus is well settled:
"`"Mandamus is an extraordinary remedy and requires a showing that 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 Medical Assurance Co., 862 So.2d 645, 649 (Ala.2003) (quoting Ex parte Inverness Constr. Co., 775 So.2d 153, 156 (Ala.2000)). The question of subject-matter jurisdiction is reviewable by a petition for a writ of mandamus. Ex parte Flint Constr. Co., 775 So.2d 805 (Ala.2000).

Analysis
Stewart argues that the circuit court in case no. CV-99-338 lacked subject-matter jurisdiction because the law firms' complaint is a collateral attack on the final judgment in case no. CV-96-297. Stewart contends that the circuit court's final judgment in case no. CV-96-297 approved the attorney-fee award and that the law firms' complaint attempts to usurp the discretion exercised by the circuit court in supervising the class action in case no. CV-96-297. Stewart further argues that the circuit court in case no. CV-96-297 expressly retained continuing jurisdiction over matters relating to the settlement agreement, including the award of attorney fees.
In Ex parte Liberty National Life Insurance Co., 888 So.2d 478 (Ala.2003), the plaintiffs sued their insurer in the Choctaw Circuit Court, alleging breach of contract, unjust enrichment, misrepresentation, and suppression. The plaintiffs had been members of a class certified in a class action filed in the Barbour Circuit Court. The settlement agreement in the class action provided that the insurer was to offer class members a special policy, which the insurer did. The settlement agreement in the class action provided that the Barbour Circuit Court had reserved and maintained "`continuing jurisdiction over all matters *408 relating to the Settlement or the consummation of the Settlement; the validity of the Settlement; the construction and enforcement of the Settlement and any orders entered pursuant thereto; ... and all other matters pertaining to the Settlement or its implementation and enforcement.'" 888 So.2d at 480 (quoting Adams v. Robertson, 676 So.2d 1265, 1307 (Ala.1995)). The plaintiffs complained that the special policies issued caused the premiums in those policies to increase substantially.
This Court in Ex parte Liberty National held that the plaintiffs' action was an attempt to collaterally attack portions of the settlement agreement. We stated:
"This type of collateral attack is not permitted. The boundary lines between courts of concurrent jurisdiction must be preserved. `"`[W]here two courts have equal and concurrent jurisdiction, the court that first commences the exercise of its jurisdiction in a matter has the preference and is not to be obstructed in the legitimate exercise of its powers by a court of coordinate jurisdiction.'"' Ex parte First Nat'l Bank of Jasper, 717 So.2d 342, 350 (Ala.1997) (quoting Ex parte Liberty Nat'l Life Ins. Co., 631 So.2d 865, 867 (Ala. 1993), quoting in turn Ex parte State ex rel. Ussery, 285 Ala. 279, 281, 231 So.2d 314, 315 (1970)).
"The Barbour Circuit Court expressly retained continuing jurisdiction over matters relating to the Robertson settlement and the enforcement of that settlement. Therefore, the Choctaw Circuit Court does not have jurisdiction to hear this action, which is essentially an attack in another circuit court on the Robertson settlement."
888 So.2d at 481.
When this Court released its opinion in Ex parte Liberty National, the same plaintiffs in Ex parte Liberty National filed in the Barbour Circuit Court a complaint identical to the complaint they had filed in the Choctaw Circuit Court. See Solomon v. Liberty Nat'l Life Ins. Co., 953 So.2d 1211 (Ala.2006). The insurer filed a motion to dismiss, asserting, among other things, that the most recent complaint was barred by the pendency of the class action and by the Choctaw Circuit Court's retention of continuing jurisdiction over all matters relating to the settlement agreement as addressed in Ex parte Liberty National. Before that motion was ruled upon, however, the insurer and the plaintiffs submitted a new proposed class and class settlement to the Barbour Circuit Court for its preliminary approval. The trial court entered an order preliminarily approving the new class and ordered that notice be sent to class members. One of the new class members (who had been a member of the previous class) objected on the grounds that the trial court lacked subject-matter jurisdiction. Subsequently, the trial court entered an order, sua sponte, purporting to consolidate both class actions. On appeal, this Court held that simply refiling in the Barbour Circuit Court the complaint they had filed in the Choctaw Circuit Court did not remove the jurisdictional bar imposed by the final judgment in the original class-action settlement. Rather than seeking to have the Barbour Circuit Court address the claims asserted by the plaintiffs as matters related to the original class and class-action settlement, the plaintiffs attempted to certify a new class in an independent action. However, this did not solve the jurisdictional problem created by the plaintiffs' presenting their claims in an action independent from the original class action.
In the present case, we conclude that Stewart is entitled to the relief sought. The court in case no. CV-96-297 approved the class-action settlement agreement, and that court retained jurisdiction *409 over matters relating to the settlement agreement, including attorney fees. Although the law firms filed their complaint in case no. CV-99-338 in the same circuit court, that court did not have subject-matter jurisdiction over case no. CV-99-338 regarding the attorney fees awarded in the Lovelace class action; therefore, we order the court to enter an order dismissing the law firms' complaint in case no. CV-99-338. "Where `the trial court ha[s] no subject-matter jurisdiction, [it has] no alternative but to dismiss the action.'" Gulf Beach Hotel, Inc. v. State ex rel. Whetstone, 935 So.2d 1177, 1182 (Ala. 2006) (quoting State v. Property at 2018 Rainbow Drive, 740 So.2d 1025, 1029 (Ala. 1999)). A dismissal for lack of subject-matter jurisdiction does not operate as an adjudication on the merits. Ex parte Capstone Dev. Corp., 779 So.2d 1216 (Ala. 2000).
PETITION GRANTED; WRIT ISSUED.
LYONS, STUART, SMITH, and MURDOCK, JJ., concur.
COBB, C.J., recuses herself.
NOTES
[1]  Stewart does not give us the names of any of the appellants or any docket numbers of cases she says were appealed to this Court.
[2]  The complaining law firms in case no. CV-99-338 were: Furth, Fahrner & Mason, P.C.; McKay, Burton & Thurman, P.C.; Sperling & Slater, P.C.; Richard L. Coffman, P.C.; Langston & Associates; and Towe, Ball, Enright, Mackey & Sommerfield, P.L.L.P.
