
324 S.W.3d 756 (2010)
CITY OF LAKE SAINT LOUIS, Missouri, Appellant,
v.
CITY OF O'FALLON, Missouri, Respondent.
No. SC 90790.
Supreme Court of Missouri, En Banc.
October 26, 2010.
*758 Jeffrey T. McPherson, Jay A. Summerville and Jonathan D. Valentino, Armstrong Teasdale LLP, St. Louis, for Lake St. Louis.
Kevin M. O'Keefe, Stephanie E. Karr, Curtis, Heintz, Garrett & O'Keefe PC, St. Louis, for O'Fallon.
LAURA DENVIR STITH, Judge.
The city of Lake Saint Louis appeals the trial court's dismissal of its petition for declaratory judgment that certain disputed property is within its boundaries and that the city of O'Fallon's attempted annexation of it is invalid. O'Fallon filed a motion to dismiss on the basis that Lake St. Louis had no authority to seek a declaratory judgment because the sole mechanism for determining whether its annexation of the disputed property was proper is to have the attorney general or prosecuting attorney of St. Charles County file a quo warranto action. The trial court granted O'Fallon's motion to dismiss.
Lake St. Louis appeals, arguing that a municipality itself has the right to bring a declaratory judgment to determine its boundaries rather than being forced solely to rely on the discretion of the attorney general and the county's prosecuting attorney as to whether to bring a quo warranto action on the municipality's behalf.
This Court agrees. While individuals are not authorized to bring a declaratory judgment action to determine a boundary dispute as to a municipality, this limitation does not apply to a suit brought by the affected municipality, school district or other public corporation itself. To the extent State ex inf. Sanders, ex rel. City of Lee's Summit v. City of Lake Lotawana, 220 S.W.3d 794 (Mo.App.2007), and State ex rel. Members of Bd. of Educ. of Everton R-III Sch. Dist. v. Members of Bd. of Educ. of Greenfield R-IV Sch. Dist., 572 S.W.2d 899 (Mo.App.1978), suggest to the contrary, they no longer should be followed. Accordingly, the judgment granting the motion to dismiss is reversed, and the case is remanded.

I. FACTUAL AND PROCEDURAL BACKGROUND
Lake St. Louis and O'Fallon are municipalities in St. Charles County. On March 26, 2009, Lake St. Louis filed a petition for declaratory judgment against O'Fallon in which Lake St. Louis alleged that, in 1982, it annexed certain property to the north of its prior boundary, making its northern boundary run along Interstate 70 in St. Charles County. The petition alleged that "O'Fallon disputes the northern boundary of Lake Saint Louis and claims to have subsequently annexed property, issued permits, and taken other actions within the boundary of Lake Saint Louis...."[1] The petition did not state when O'Fallon undertook its allegedly improper annexation. It did aver that Lake St. Louis had a legally protectable interest in enforcing its ordinances, collecting and administering taxes, *759 and protecting the rights of the city and its residents in the disputed area and asked the trial court to enter judgment declaring that the northern boundary of Lake St. Louis included the area that Lake St. Louis had annexed in 1982 and that O'Fallon had not legally annexed property within that boundary.
On April 30, 2009, O'Fallon filed a motion to dismiss in lieu of filing an answer. The motion asserted that Lake St. Louis was not entitled to bring a declaratory judgment action to determine its boundaries and that, in any event, the statute of limitations to do so had expired. The trial court granted O'Fallon's motion to dismiss without stating on which ground it ruled. Following a decision by the Missouri Court of Appeals, Eastern District, this Court granted transfer. MO. CONST. ART. V, § 10.

II. STANDARD OF REVIEW
"[A] motion to dismiss for failure to state a cause of action is solely a test of the adequacy of the plaintiff's petition." Reynolds v. Diamond Foods & Poultry, Inc., 79 S.W.3d 907, 909 (Mo. banc 2002). A court reviews the petition "in an almost academic manner, to determine if the facts alleged meet the elements of a recognized cause of action, or of a cause that might be adopted in that case." Nazeri v. Mo. Valley Coll., 860 S.W.2d 303, 306 (Mo. banc 1993). In so doing, a court takes a plaintiff's averments as true and liberally grants plaintiff all reasonable inferences. It will not weigh the credibility or persuasiveness of facts alleged. Id. Accord, Reynolds, 79 S.W.3d at 909.
An appellate court reviews a trial court's grant of a motion to dismiss de novo. Lynch v. Lynch, 260 S.W.3d 834, 836 (Mo. banc 2008). It will consider only the grounds raised in the motion to dismiss in reviewing the propriety of the trial court's dismissal of a petition, and, in so doing, it will not consider matters outside the pleadings. Brennan By and Through Brennan v. Curators of the Univ. of Mo., 942 S.W.2d 432, 434 (Mo.App.1997). Here, the merits of Lake St. Louis's declaratory judgment claims regarding its boundaries were not a ground of the motion to dismiss and, therefore, are not reached on this appeal. See Rule 55.27(a). This Court considers solely whether the grounds raised in the motion supported dismissal.

III. A SCHOOL DISTRICT MAY BRING A DECLARATORY JUDGMENT ACTION TO DETERMINE ITS PROPER BOUNDARIES
Lake St. Louis argues that the filing of a declaratory judgment action is an appropriate mechanism by which a municipality can resolve a boundary dispute. O'Fallon disagrees, arguing that Lake St. Louis ultimately is seeking to oust O'Fallon from the contested land and, therefore, the exclusive remedy is through a writ of quo warranto. As it is undisputed that only the attorney general or a prosecuting or circuit attorney can bring an action in quo warranto, Rule 98.02, O'Fallon argues that Lake St. Louis has no authority to seek or obtain the relief it sets out in its petition.
For the reasons noted below, while O'Fallon is correct that individuals are not permitted to bring declaratory judgment actions seeking to determine boundaries or to oust a municipal or other public corporation from disputed territory, municipalities, school districts and other public corporations are permitted to bring such actions.

A. Individuals May Not Bring Quo Warranto or Declaratory Judgment Actions to Oust Another from Disputed Territory
Rule 98.02 provides that, "(a) Proceedings in quo warranto shall be by a civil *760 action in which the party seeking relief is relator and the person against whom such relief is sought is respondent, which action shall be brought in the name of the State of Missouri." See also § 531.010 et seq., RSMo 2000.[2] To bring an action in quo warranto the "attorney general, prosecuting attorney, or circuit attorney may file an information ex officio, by virtue of the power of his [or her] office without leave of court when such an action would serve the public interest." State ex inf. Graham v. Hurley, 540 S.W.2d 20, 22 (Mo. banc 1976). The purpose of the action is to determine whether there has been a usurpation of "any office or franchise" and, if so, pray the court "oust" any such illegal holder. § 531.010; § 531.050.
An action in quo warranto may be brought by the attorney general or prosecutor on behalf of the state directly or at the relation of another, Rule 98.02(b); Rule 98.04, including an individual who seeks to determine the legality of an annexation.[3]

B. An Individual May Not File for Declaratory Relief to Resolve a Boundary Dispute
"A declaratory judgment provides guidance to the parties, declaring their rights and obligations or otherwise governing their relationship," Shipley v. Cates, 200 S.W.3d 529, 534 (Mo. banc 2006), and generally may be granted when a court is presented with:
(1) a justiciable controversy that presents a real, substantial, presently-existing controversy admitting of specific relief, as distinguished from an advisory decree upon a purely hypothetical situation; (2) a plaintiff with a legally protectable interest at stake, "consisting of a pecuniary or personal interest directly at issue and subject to immediate or prospective consequential relief;" (3) a controversy ripe for judicial determination; and (4) an inadequate remedy at law.
Mo. Soybean Ass'n v. Mo. Clean Water Comm'n, 102 S.W.3d 10, 25 (Mo. banc 2003).
Individuals sometimes have sought to bypass the prohibition on an individual bringing a quo warranto action by seeking the same relief in a suit for an injunction or for declaratory judgment. Spiking Sch. Dist. No. 71, DeKalb Cnty. v. Purported "Enlarged Sch. Dist. R-II, DeKalb Cnty., Mo.", 362 Mo. 848, 245 S.W.2d 13, 15 (1952), provides a good example. Certain individual residents of a school district sought a declaratory judgment that a new and enlarged school district was invalidly formed and that their previous school districts continued to exist.
In approving dismissal of their petition, this Court stated that "a declaratory judgment action is not available to the individual plaintiffs who are residents, patrons and taxpayers of the reorganized district" because "they are only indirectly affected by the lack of de jur[e] existence of the reorganized district and the attempted action by them is in the nature of a collateral attack." Id. at 21. It prohibited such collateral attacks by individuals because individuals necessarily are only indirectly affected by whether a public or municipal corporation has a de jure existence. If *761 one resident could bring suit, then all could, and "it is intolerable that, every time a city sues on an account, it must first establish its right to exist." Id. (internal citations and quotations omitted).
For these reasons, "[t]he law is settled that when a public body has, under color of authority, assumed to exercise the powers of a public corporation of a kind recognized by law, so as to become at le[a]st a de facto corporation, the validity of its organization can be challenged only by direct proceedings in quo warranto by the state through its officers designated in [section] 531.010, and cannot be challenged by individuals." State ex rel. Junior Coll. Dist. of Sedalia v. Barker, 418 S.W.2d 62, 65 (Mo. banc 1967). As a matter of public policy, suits by individuals are not permitted due to "the importance of stability and certainty in such matters, and the serious consequences which might follow if the existence of a public corporation could be called in question by persons who do not have an interest in the matter separate and distinct from that of the State itself." Id. at 65-66 (internal citations and quotations omitted). "[C]orporate franchises are grants of sovereignty only, and, if the state acquiesces in their usurpation, individuals will not be heard to complain." Id. (internal citations and quotations omitted).

C. Municipalities May Bring Declaratory Judgment Actions to Determine their Boundaries
Lake St. Louis does not disagree with the general rule that quo warranto offers the exclusive means of relief for individuals; they may not sue in their own right and may act as relators only in an action brought in the name of the state by the attorney general or county prosecutor. But, Lake St. Louis argues, this Court never has held that the sound reasoning underlying this rule applies when the dispute is between two municipalities or other public corporations concerning which one of them has the valid claim over a disputed area. In such cases, it suggests, a public corporation is the party directly affected by the territorial dispute. While the attorney general and prosecutor also may bring a suit in quo warranto on behalf of such a governmental entity, whether they choose to do so is within those officials' discretion. The governmental entity, therefore, as the party directly affected, should have the right instead to bring a declaratory judgment action in its own name to vindicate its directly affected interest in the office or territory.
This Court has recognized on at least two occasions that the question of whether a public school district can bring a declaratory judgment action to resolve a territorial dispute is not resolved by the cases holding that individuals are not authorized to bring such actions. In 1952, Spiking noted the general rule regarding individuals but then found that because the plaintiffs in the action before it were not actually existing school districts (they had been dissolved prior to suit being brought):
It is unnecessary to determine whether, under particular circumstances, an alleged existing common school district may by a declaratory judgment action directly attack the validity of an alleged reorganization proceeding which purports to destroy said district by consolidation or reorganization with other districts.
245 S.W.2d at 21. In 1967, while reaffirming the general rule that an individual is not authorized to bring a declaratory judgment action to challenge the validity of a district boundary and, instead, suit must be brought by the state in a quo warranto action, this Court similarly recognized that this holding was not dispositive of the question whether such a suit could be brought by the district itself, stating:

*762 Compare: Walker Reorganized School District R-4 v. Flint et al., Mo.App., 303 S.W.2d 200, 205-206(2), cited by respondent, holding that one school district can maintain an action against another school district for a judgment declaring that defendant district had become a part of plaintiff district by annexation. In so holding the court referred specifically to page 21 of the Spiking case (245 S.W.2d and noted "... that the Supreme Court has been careful to leave the door open for the decision that the cases in which individuals are endeavoring to attack the validity of an annexation or a reorganization through a proceeding other than by quo warranto in the name of the State are not necessarily controlling where two school districts are claiming the same territory." ... See also: Reorganized School District R-I of Crawford County v. Reorganized School District R-III of Washington County, Mo.App., 360 S.W.2d 376, 378(1-2).
Barker, 418 S.W.2d at 65 n. 1.
Walker Reorganized Sch. Dist. R-4 v. Flint, one of the cases cited in the Barker footnote, specifically noted that Spiking had left "the door open" for declaratory judgment actions when "two school districts are claiming the same territory." 303 S.W.2d 200, 206 (Mo.App.1957). Walker walked through the door, holding that the public policy concerns behind prohibiting individuals from bringing an independent action had no application in suits involving public school districts. It held that because these municipal bodies' interests are affected directly by a dispute over their own boundaries, they should be permitted to bring a declaratory judgment action:
Both plaintiff and intervenor are public school districts. Each in its public corporate capacity is claiming the same territory, the Coal Creek District.... Both plaintiff and intervenor have a direct interest in the matter. There is no threat of harassment by individuals questioning the validity of a school district. To permit plaintiff and intervenor, in a declaratory judgment action, to determine the question of which took the first valid step to acquire the Coal Creek District does not appear to violate any of the reasons for the rule that an individual cannot question in legality of the organization of a school district by a declaratory judgment action, but must proceed, if at all, by quo warranto in the name of the State. Since the reason for that rule fails as applied to this case we do not apply the rule.
Id. at 205-06 (emphasis added).[4]
O'Fallon nonetheless urges this Court to close the door left open in Spiking by holding that the prohibition on declaratory judgment actions by individuals also applies to school districts and other public corporations. In support, it cites State ex rel. Members of Bd. of Educ. of Everton R-III Sch. Dist. v. Members of Bd. of Educ. of Greenfield R-IV Sch. Dist., 572 S.W.2d 899 (Mo.App.1978), and State ex inf. Sanders, ex rel. City of Lee's Summit v. City of Lake Lotawana, 220 S.W.3d 794 (Mo.App.2007). This Court rejects that invitation.
*763 While Everton did conclude that school district boundaries could "only be determined in quo warranto," 572 S.W.2d at 900, it cited only State ex inf. Dalton ex rel. Hough v. Eckley, 347 S.W.2d 704 (Mo. banc 1961), and State ex rel. Purdy Reorganized Sch. Dist. No. II v. Snider, 470 S.W.2d 805, 809 (Mo.App.1971), to support that conclusion.
Neither case involved a declaratory judgment action brought by one school district or municipality against another, however, nor did either offer any reasoning why such declaratory judgment suits would not be proper. Moreover, Dalton merely noted (as this Court reaffirms today) that a suit in quo warranto is "a proper remedy to test the jurisdiction of a school board over territory claimed by another school district," 347 S.W.2d at 707 (emphasis added). It did not address whether other procedural alternatives also were available.[5]
Lake Lotawana, the other case involving a public corporation relied on by O'Fallon,[6] cites only to Everton and a case involving a suit by individuals, State ex rel. Kansas City v. Harris, 357 Mo. 1166, 212 S.W.2d 733 (1948), and is similarly unpersuasive. Indeed, Lake Lotawana fails to cite Walker, Crawford, Spiking or Barker and offers no independent reasons why a declaratory judgment action should not be permitted where a municipality or school district seeks a declaratory judgment as to its own boundaries.
This Court finds Walker's reasoning more persuasive. To require a directly affected municipality or other similar public corporation to rely on a third party the attorney general or a county prosecutorto bring suit over its very boundaries would risk leaving it without a remedy if the attorney general and prosecutor exercise their discretion not to act. While this is appropriate where an individual litigant is involved, to avoid the multiplicity of suits that otherwise would ensue and to ensure that spurious claims are not asserted in an effort to adversely affect the public body, such reasoning does not apply to the municipality or other public corporation itself, as it has a direct and vital interest in determining its own boundaries.
To the extent Everton and Lake Lotawana hold otherwise, they no longer should be followed. While they are correct that a quo warranto action by the attorney general or prosecuting or circuit attorney at the relation of the public corporation is proper to determine a boundary dispute such as this under Rule 98.02, so too is a declaratory judgment action brought directly by the municipality or other public corporation itself.

D. The Statute of Limitations
The motion to dismiss filed below also raised statute of limitations and laches defenses. Because the court failed to state the reasons for dismissal, this Court is unable to determine whether the dismissal was based on those grounds or on the ground principally relied on, that a *764 municipality may not bring a declaratory judgment action. Allegations based on the statute of limitations or laches are in the nature of affirmative defenses and, as such, usually are raised in the answer. Lynch, 260 S.W.3d at 837. Here, however, O'Fallon brought its motion to dismiss in lieu of filing an answer. At this point, therefore, this Court can look only to the petition to determine whether dismissal was proper based on laches or the statute of limitations. Sheehan v. Sheehan, 901 S.W.2d 57, 59 (Mo. banc 1995). The petition alleges only that, between 1982 and the present, O'Fallon purported to annex certain property that in 1982 had been annexed by Lake St. Louis. Because the petition does not show on its face that the action is barred by the statute of limitations or laches, it would have been error to dismiss on these grounds.

IV. CONCLUSION
Dismissal of Lake St. Louis's petition was unwarranted. The trial court's judgment is reversed, and the case is remanded.
All concur.
NOTES
[1]  On October 31, 2008, O'Fallon's city counselor stated in a letter to St. Charles County officials that the city disputed the northern boundary of Lake St. Louis and believed adjudication of the dispute between Lake St. Louis and O'Fallon as to their respective boundaries should be resolved in court.
[2]  The portion of section 531.010 authorizing one circuit court to exercise authority over another judge of an adjoining county was found to violate Article V, Section 4(1) of the Missouri Constitution in State v. Kinder, 89 S.W.3d 454, 458-59 (Mo. banc 2002).
[3]  See e.g., State ex inf. Ashcroft, ex rel. Curators of Univ. of Mo. v. Town of Weldon Springs Heights, 582 S.W.2d 661 (Mo. banc 1979); State ex rel. Dalton ex rel. Stonum v. Reorganized Dist. No. II, Clinton Cnty., 307 S.W.2d 501, 502 (Mo. banc 1957).
[4]  Reorganized Sch. Dist. R-I of Crawford Cnty. v. Reorganized Sch. Dist. R-III of Washington Cnty., 360 S.W.2d 376, 378 (Mo.App.1962), also cited by this Court in Barker, followed Walker in holding a declaratory judgment was proper, stating:

Ordinarily matters affecting the legality of the organization of a school district cannot be inquired into except by quo warranto in the name of the state. This action, however, is between two school districts.... [A] declaratory judgment action will lie in a dispute such as this between two school districts.
[5]  While Purdy did state in dicta that the rights of school districts contesting the same territory should be settled in quo warranto, 470 S.W.2d at 809, Purdy cited only Dalton and Spiking to support its statement. As just noted, Dalton does not so hold and, as discussed in the text, Spiking specifically left open the question whether the reasoning for denying individuals the right to bring a declaratory judgment action would apply to school districts.
[6]  The suits by individuals that O'Fallon also cites are not on point for the reasons noted above. See, e.g., Cherry v. City of Hayti Heights, 563 S.W.2d 72 (Mo. banc 1978); White v. City of Columbia, 461 S.W.2d 806 (Mo. banc 1970).
