Baldwin County (“the County”) appeals from a judgment on the pleadings entered in favor of Baldwin County Cattle & Fair Association, Inc. (“the Fair Association”). We reverse and remand.
I. Factual Background and Procedural History
On or about June 14, 2004, the Baldwin County Commission passed a resolution recognizing the Fair Association’s planned construction of a multimillion dollar coliseum at the Fair Association’s new fairgrounds site in Baldwin County. The Fair Association is a nonprofit corporation that operates the Baldwin County Fair. In the resolution, the Commission resolved to provide long-term funding for the Fan-Association in the amount of $75,000 annually for a period of 10 years, beginning in the County’s 2005 fiscal year.
On October 18, 2005, the County and the Fair Association entered into a memorandum of understanding, pursuant to which the parties agreed that the Fair Association would construct the new coliseum to standards suitable for the County to use as a hurricane-evacuation shelter. The parties further agreed that, upon the completion of construction, the coliseum property would be conveyed to the County, which would then lease the property back to the Fair Association. The memorandum of understanding additionally provided that, once the property was conveyed to the County, the County would be relieved from its commitment to make the annual $75,000 payment to the Fair Association.
On September 10, 2008, the County and the Fair Association entered into a real-estate sale and purchase agreement for the conveyance of the coliseum property to the County. The purchase agreement provided that the County would be “released and relieved from paying [the Fair Association] the Seventy Five Thousand Dollars ($75,000.00), annual payment....” Following conveyance of the coliseum property, on September 29, 2008, the parties entered into a lease agreement for the property. The lease was for a term of 75 years, and the agreement provided that the Fair Association would pay annual rent to the County in the amount $15,000 plus 15 percent of the Fair Association’s net revenues.
Despite the parties’ agreement to discontinue the annual $75,000 payment to the Fair Association, the County made two additional payments — one in 2009 and another in 2010. Each additional payment *970was presented to the County Commission as part of the “County Commission Accounts Payable Payments” and was approved by the Commission along with payments to other vendors. The County now asserts that the two $75,000 payments were made by mistake and were the result of failure of the County’s clerk/treasurer to discontinue the automatic transfers and payments set up following adoption of the June 2004 resolution. The County also contends that the Fair Association owes it $32,762 in past-due rent and other financial obligations under the lease agreement.
On July 3, 2012, the County, by and through the County Commission, filed this lawsuit against the Fair Association in the Baldwin Circuit Court. The complaint alleged that the two $75,000 payments to the Fair Association were made in error; that the Fair Association knew or should have known that the payments were in error; and that the Fair Association has retained the funds rather than return the moneys to the County. Counts one, two, and three of the complaint assert claims for money had and received, money paid by mistake, and unjust enrichment, respectively. Each count seeks damages in the amount of $150,000. Count four of the complaint asserts a claim of breach of the lease agreement and alleges that the Fair Association has failed to pay rents and other financial obligations it incurred under the lease agreement. The County seeks damages in the amount of $32,762 as a result of the Fair Association’s alleged breach and also demands rescission of the lease agreement.
On August 20, 2012, the Fair Association filed a motion for a judgment on the pleadings pursuant to Rule 12(c), Ala. R. Civ. P. The motion asserted two grounds. First, the Fair Association argued the County’s claims for money had and received, money paid by mistake, and unjust enrichment were each barred by the separation-of-powers doctrine. According to the Fair Association, the judiciary may not interfere with what the Fair Association contends was a valid appropriation of funds by the County. In support of its argument, the Fair Association attached excerpts of published minutes of the two County Commission meetings at which the Commission approved the two additional $75,000 payments to the Fair Association as part of an “Accounts Payable Payment.” Second, the Fair Association argued that the circuit court lacked subject-matter jurisdiction over the claim alleging breach of the lease agreement. The Fair Association contends that an action seeking compensatory damages for breach of a lease or rescission of a lease must be brought as an unlawful-detainer action originating in the Baldwin District Court. The County filed a brief in opposition to the motion.
A hearing on the motion was held on November 29, 2012. On January 11, 2013, the circuit court granted the Fair Association’s motion for a judgment on the pleadings. The County appealed.
II. Standard of Review
The motion filed by the Fair Association and granted by the circuit court was styled as a Rule 12(c), Ala.R.Civ.P., motion for a judgment on the pleadings. Although the motion may have been more appropriately styled as a Rule 12(b)(6), Ala.R.Civ.P., motion to dismiss, the Fair Association supported the motion with evidence outside the pleadings, requiring the conversion of the motion to a motion for a summary judgment.1
*971“When matters outside the pleadings are considered on a motion to dismiss, the motion is converted into a motion for summary judgment, Rule 12(b), Ala. R. Civ. P.; this is the case regardless of what the motion has been called or how it was treated by the trial court, Papastefan v. B & L Constr. Co., 356 So.2d 158 (Ala.1978); Thome v. Odom, 349 So.2d 1126 (Ala.1977). ‘Once matters outside the pleadings are considered, the requirements of Rule 56, Ala. R. Civ. P., become operable and the “moving party’s burden changes and he is obliged to demonstrate that there exists no genuine issue as to any material fact and that he is entitled to a judgment as a matter of law.” C. Wright & A. Miller, Federal Practice & Procedure, Civil, 1366 at 681 (1969).’ Boles v. Blackstock, 484 So.2d 1077, 1079 (Ala.1986). The effect of converting the defendants’ motion to dismiss into a motion for summary judgment was to impose upon the defendants the burden of meeting the two-part summary judgment standard, that is, the burden of showing that there is no genuine issue of material fact and that the defendants are entitled to a judgment as a matter of law. Rule 56, Ala. R. Civ. P.”
Hornsby v. Sessions, 703 So.2d 932, 937-38 (Ala.1997). We have recently described the standard of review applicable to a summary judgment:
‘“This Court’s review of a summary judgment is de novo. Williams v. State Farm Mut. Auto. Ins. Co., 886 So.2d 72, 74 (Ala.2003). We apply the same standard of review as the trial court applied. Specifically we must determine whether the movant has made a prima facie showing that no genuine issue of material fact exists and that the movant is entitled to a judgment as a matter of law. Rule 56(c), Ala. R. Civ. P.; Blue Cross & Blue Shield of Alabama v. Hodurski, 899 So.2d 949, 952-53 (Ala.2004). In making such a determination, we must review the evidence in the light most favorable to the nonmovant. Wilson v. Brown, 496 So.2d 756, 758 (Ala.1986). Once the movant makes a prima facie showing that there is no genuine issue of material fact, the burden then shifts to the nonmovant to produce “substantial evidence” as to the existence of a genuine issue of material fact. Bass v. SouthTrust Bank of Baldwin County, 538 So.2d 794, 797-98 (Ala.1989); Ala. Code 1975, § 12-21-12.’ ”
Patterson v. Consolidated Aluminum Corp., 101 So.3d 743, 746 (Ala.2012)(quoting Dow v. Alabama Democratic Party, 897 So.2d 1035, 1038-39 (Ala.2004)).
III. Analysis
The Fair Association argues that application of the separation-of-powers doctrine compels us to affirm the judgment of the circuit court with respect to Count one (money had and received), Count two (money paid by mistake), and Count three (unjust enrichment) of the County’s complaint. Each of those counts *972seeks recovery of the two $75,000 payments made by the County to the Fair Association after the execution of the purchase agreement. According to the Fair Association, each payment represents a valid legislative appropriation that was duly approved by the County Commission. The County, on the other hand, which is suing by and through the County Commission, asserts that the payments were approved and paid by mistake, that it has a right to bring this action in its name for the recovery of the funds, and that the separation-of-powers doctrine does not apply-
The Constitution of Alabama expressly adopts the separation-of-powers doctrine. Birmingham-J efferson Civic Ctr. Auth. v. City of Birmingham, 912 So.2d 204 (Ala.2005). Section 42, Ala. Const.1901, divides the power of state government into three distinct departments: the legislative, the executive, and the judicial. We have stated that “the core judicial power is the power to declare finally the rights of parties, in a particular case or controversy, based on the law at the time the judgment becomes final.” Ex parte Jenkins, 723 So.2d 649, 656 (Ala.1998). Under § 48, Ala. Const.1901, however, the judicial branch “shall never exercise the legislative and executive powers, or either of them.” We have interpreted Section 43 to mean that “this Court will not decide ‘political questions,’ even if submitted to it.” City of Birmingham, 912 So.2d at 214. In determining what constitutes a nonjusticiable political question, this Court has adopted the formulation set forth by the United State Supreme Court in Baker v. Carr, 369 U.S. 186, 82 S.Ct. 691, 7 L.Ed.2d 663 (1962):
“ ‘It is apparent that several formulations which vary slightly according to the settings in which the questions arise may describe a political question, although each has one or more elements which identify it as essentially a function of the separation of powers. Prominent on the surface of any case held to involve a political question is found [1] a textually demonstrable constitutional commitment of the issue to a coordinate political department; or [2] a lack of judicially discoverable and manageable standards for resolving it; or [3] the impossibility of deciding without an initial policy determination of a kind clearly for nonjudicial discretion; or [4] the impossibility of a court’s undertaking independent resolution without expressing lack of the respect due coordinate branches of government; or [5] an unusual need for unquestioning adherence to a political decision already made; or [6] the potentiality of embarrassment from multifarious pronouncements by various departments on one question.’”
City of Birmingham, 912 So.2d at 214-15 (quoting Baker, 369 U.S. at 217).
Particular examples of our application of the separation-of-powers doctrine include our holdings in City of Birmingham, supra, in which we held that the question as to whether a statute had passed the Alabama House of Representatives with a proper quorum was a nonjusticiable political question, and Ex parte James, 836 So.2d 813 (Ala.2002), in which we concluded that any remedy that we could impose with regard to the question of the constitutionality of the State’s method for funding the public-school system would necessarily usurp the power of the legislature. We have held that the separation-of-powers doctrine does not apply to local municipal governments. State ex rel. Wilkinson v. Lane, 181 Ala. 646, 658, 62 So. 31, 34 (1913). Moreover, it should be noted that we have long recognized the ability of a public body to recover funds mistakenly or illegally paid out. See, e.g., City of De-*973mopolis v. Marengo Cnty., 195 Ala. 214, 70 So. 275 (1915); Mobile Cnty. v. Williams, 180 Ala. 639, 61 So. 963 (1913); and Ledger Publ’g Co. v. Miller, 170 Ala. 437, 54 So. 52 (1910).
The present case does not present a political question sufficient to invoke the separation-of-powers doctrine. Here the County, by and through the County Commission, asserts that it mistakenly approved continued payments toward an old funding obligation to the Fair Association. The County, which is permitted by the laws of Alabama to sue and be sued, asserts various equitable claims seeking recovery of the money it claims was mistakenly paid to the Fair Association. Deciding whether the County is entitled to recover under any of its asserted theories will not risk improper judicial intrusion into the province of a coordinate branch of government. Accordingly, judicial review of the County’s action is not barred by the separation-of-powers doctrine.
Next, we must determine whether the circuit court properly entered a judgment in favor of the Fair Association as to the County’s claims of breach of the lease agreement and rescission. Citing Darby v. Schley, 8 So.3d 1011 (Ala.Civ.App.2008), the Fair Association argues that the County’s lease claims are in the nature of an unlawful-detainer action and, therefore, that original jurisdiction for the County’s claims lies exclusively with the Baldwin District Court. In contrast, the County argues that its breach-of-lease and rescission claims do not seek possession of the premises and therefore are not claims for unlawful detainer. The County’s argument is well taken.
Count four of the County’s complaint seeks monetary damages from the Fair Association in the amount of alleged unpaid rent and other financial obligations due under the lease agreement. Count four further demands rescission of the lease agreement. There appears to be no dispute that the Fair Association remains in lawful possession of the leased premises under the lease agreement.
The Fair Association principally relies on the Court of Civil Appeals’ statement in Darby v. Schley, 8 So.3d 1011 (Ala.Civ.App.2008):
“By statute, original jurisdiction over unlawful-detainer actions lies in the district courts. 6-6-330, Ala.Code 1975 (‘The forcible entry upon and detainer, or the unlawful detainer, of lands, tenements and hereditaments is cognizable before the district court of the county in which the offense is committed.’). A circuit court may not exercise jurisdiction over an unlawful-detainer action until the district court has adjudicated the unlawful-detainer action and one of the párties has appealed to the circuit court.”
8 So.3d at 1013. Section 6-6-310 of the Alabama Code defines “unlawful detainer”:
“UNLAWFUL DETAINER. Where one who has lawfully entered into possession of lands as tenant fails or refuses, after the termination of the pos-sessory interest of the tenant, to deliver possession of the premises to anyone lawfully entitled or his or her agent or attorney.”
§ 6-6-310, Ala.Code 1975. See also Ex parte McKinney, 87 So.3d 502, 507 n. 6 (Ala.2011) (“ ‘Unlawful detainer is a penal action, summary in character, specifically designed to oust a hold-over tenant.’”)(quoting Lane v. Henderson, 232 Ala. 122, 124, 167 So. 270, 271 (1936)).
The County’s action is not an action to oust the Fair Association from possession of the leased premises, and the Fair Association’s possessory interest in the premises has not been terminated. Ac*974cordingly, the action cannot be characterized as an unlawful-detainer action. Rather, the action seeks damages for the Fair Association’s alleged failure to make rental payments due under the lease agreement. The County also seeks rescission of the lease agreement. The County was not required to bring its breach-of-lease and rescission claims in the district court. Instead, these claims fall within the circuit court’s subject-matter jurisdiction. See § 142, Ala. Const.1901; Ex parte Dennis, 681 So.2d 157, 160 (Ala.Civ.App.1995) (“ ‘[Tjhere is a presumption against divestiture of jurisdiction from a court to a lower court.’ ”)(quoting Thomas v. Liberty Nat’l Life Ins. Co., 368 So.2d 254, 257 (Ala.1979)).2
IV. Conclusion
We reverse the circuit court’s judgment entered in favor of the Fair Association and remand this case for further proceedings consistent with this opinion.
REVERSED AND REMANDED.
MOORE, C.J., and BOLIN and BRYAN, JJ., concur. MURDOCK, J., concurs in the result.. The record indicates that the Fair Association did not file an answer before filing its motion, rendering a Rule 12(c) motion for judgment on the pleadings premature. See Pontius v. State Farm Mut. Auto. Ins. Co., 915 So.2d 557, 562 (Ala.2005)(" ‘Motions brought *971under Rule 12(c) cannot be filed until "[ajfter the pleadings are closed” (i.e., after filing its answer).' "Xquoting Reed Elsevier, Inc. v. TheLaw.net Corp., 269 F.Supp.2d 942, 947 (S.D.Ohio 2003)). The substance of a motion, however, and not what a party styles it, determines the nature of the motion. Lloyd Noland Found., Inc. v. HealthSouth Corp., 979 So.2d 784, 792 (Ala.2007). For a discussion on the differences between a Rule 12(b) motion to dismiss and a Rule 12(c) motion for a judgment on the pleadings, see Pontius, 915 So.2d at 561-62. Regardless of whether the motion was filed pursuant to Rule 12(b)(6) or Rule 12(c), when “matters outside the pleadings are presented to and not excluded by the court, the motion shall be treated as one for summary judgment....” Rules 12(b) and (c), Ala. R. Civ. P.
. We note that the Fair Association, for the first time on appeal, makes several new arguments in favor of affirming the judgment of the circuit court. " '[Tjhis Court will affirm a judgment for any reason supported by the record that satisfies the requirements of due process, Taylor v. Stevenson, 820 So.2d 810, 814 (Ala.2001), even where the ground upon which we affirm was not argued before the trial court or this Court. Ex parte CTB, Inc., 782 So.2d 188, 191 (Ala.2000).’ ” CitiFinancial Corp. v. Peoples, 973 So.2d 332, 340 (Ala.2007) (quoting Smith v. Mark Dodge, Inc., 934 So.2d 375, 380 (Ala.2006)).
Several of the Fair Association's arguments challenge the validity of the purchase agreement, including the provision relieving the County of the annual $75,000 payment to the Fair Association. For example, the Fair Association argues that the merger clause contained in the subsequently signed lease agreement invalidates the purchase agreement. We have reviewed these additional arguments and, in light of the record before us, do not find that they form a basis for affirming the judgment of the circuit court.