Plaintiffs say they have a son-student in the R-2 School District High School at El *773Dorado Springs and that defendants (members of the board of education, principal of the high school and superintendent of the school district) require each student to make a refundable book deposit before textbooks are issued. Claiming the book-deposit requirement violated the Free Textbook Law (§ 170.051, V.A.M.S.) and certain provisions of the Missouri Constitution, plaintiffs first sought a writ of mandamus to make defendants furnish their son with necessary textbooks “free of charge and without the necessity of any deposit.” An alternative writ issued and defendants made return. Following an evidentiary hearing on the question of law and facts arising upon the return, the circuit court refused the peremptory writ. Although possessed of such a right [State ex rel. Brandon v. Hickey, 462 S.W.2d 159, 161 (Mo.App.1970)], plaintiffs did not appeal from the judgment denying the peremptory writ. Subsequently plaintiffs, after changing counsel and modes of remedy, instituted the present action against defendants for a declaratory judgment. Rule 87, V.A.M.R. The petition, in substantially the same form as that employed in the mandamus action, prayed the court to declare that the book-deposit requirement contravened the law and the constitution. Defendants responded with a motion to dismiss stating, inter alia, that the judgment rendered in the mandamus suit estopped the plaintiffs from maintaining the declaratory judgment action because the mandamus judgment “is res judicata and [plaintiffs] are forever barred from taking the same or similar action and from filing a new cause of action thereon, and the [mandamus] judgment rendered therein is a bar to the action herein filed.” After receiving into evidence the entire record in the mandamus action and hearing arguments of counsel anent defendants’ motion, the court sustained the motion and dismissed the petition for declaratory judgment. Plaintiffs appealed.
In this appeal it is no concern of ours whether the judgment denying the peremptory writ of mandamus was erroneous vel non. As previously noted, plaintiffs did not appeal from the final appealable judgment denying the peremptory writ [Ex parte Skaggs, 19 Mo. 339-340 (1854)], so if the bar of res judicata is applicable here, it “applies to erroneous judgments as well as to those free from error.” Sierk v. Reynolds, 484 S.W.2d 675, 681[5] (Mo.App.1972). Jurisdiction in the sense of power to hear and decide a cause, necessarily includes the power to decide wrongly as well as rightly [Pope v. United States, 323 U.S. 1, 14, 65 S.Ct. 16, 23[16], 89 L.Ed. 3, 13[13] (1944)], and when a final judgment, although wrong, is rendered on the merits in favor of a defendant and plaintiff does not undertake to correct it on application for a new trial or appeal, the plaintiff cannot thereafter maintain a second suit on the same cause of action. Restatement, Judgments, § 48.
“ ‘It is a fundamental principle of jurisprudence that material facts or questions which were in issue in a former action, and were there admitted or judicially determined, are conclusively settled by a judgment rendered therein, and that such facts or questions become res judicata and may not again be litigated in a subsequent action between the same parties or their privies, regardless of the form the issue may take in the subsequent action, whether the subsequent action involves the same or a different form of proceeding, or whether the second action is upon the same or a different cause of action, subject matter, claim, or demand, as the earlier action. In such cases, it is also immaterial that the two actions are based on different grounds, or tried on different theories, or instituted for different purposes, and seek different relief.’ ” Varnal v. Kansas City, 481 S.W.2d 575, 579[3] (Mo.App.1972); Butler v. Manley, 416 S.W.2d 680, 682[1] (Mo.App.1967).
In keeping with the foregoing pronouncements, a final judgment rendered on the merits of an application for a peremptory writ of mandamus falls within the prin*774ciple of res judicata, so that a final judgment in a mandamus action serves as a bar to a subsequent action involving the same parties or their privies, the same issues or in which the same relief is sought. 50 C.J.S. Judgments § 608, at p. 32; 52 Am.Jur.2d, Mandamus, § 488, at p. 810; Annot., 21 A.L.R.3d 206 et seq. Thus in Ramirez-Pabon v. Board of Personnel of Puerto Rico, 254 F.2d 1 (1st Cir. 1958), where the court entered a judgment dismissing plaintiff’s action for a writ of mandamus and she did not perfect an appeal thereby permitting the judgment of dismissal to become final, plaintiff was thereafter held to be estopped under the doctrine of res judicata from relitigating the question of the power of the personnel board in a suit for declaratory judgment.
The parties and the subject matter in present plaintiffs’ action for a peremptory writ of mandamus and their suit for a declaratory judgment are identical. By the mandamus action plaintiffs sought to obtain a writ to require defendants to furnish textbooks without requiring a refundable book deposit; in their declaratory judgment suit, plaintiffs sought a judgment declaring the book-deposit requirement to be illegal. The end sought in both proceedings was the same. Since the material facts or questions relative thereto were judicially determined in the mandamus suit, the circuit court correctly concluded that under the doctrine of res judicata plaintiffs could not relitigate the matter in an action for declaratory judgment and its determination is affirmed.
All concur.