
185 Kan. 620 (1959)
347 P.2d 369
THE BOARD OF EDUCATION OF THE CITY OF HERINGTON OF THE STATE OF KANSAS, Appellee,
v.
BERT L. THOMPSON, JR., FRANCES K. THOMPSON, HELEN THOMPSON SANDERSON, et al., Appellants.
No. 41,479
Supreme Court of Kansas.
Opinion filed December 12, 1959.
Charles W. Bradshaw, of Abilene, argued the cause and Horace A. Santry, of Salina, was with him on the briefs for the appellants.
Howard W. Harper, of Junction City, argued the cause, and Lee Hornbaker, William D. Clement and Richard F. Waters, all of Junction City, were with him on the briefs for the appellee.
The opinion of the court was delivered by
JACKSON, J.:
The Board of Education filed suit in the district court to quiet title to real estate against the appellants as defendants. After filing a motion to strike and a motion to make the petition *621 more definite and the overruling of said motions by the trial court, defendants filed a demurrer to plaintiff's petition upon the grounds: 1. That several causes of action were improperly joined in said petition. 2. That the petition did not state facts sufficient to constitute a cause of action.
The trial court overruled the demurrer and gave defendants time to answer. Instead, defendants appealed the order of the court overruling the demurrer to this court. It may be said that defendants do not argue in their brief the above motions or that there is any merit in the first ground specified in the above demurrer. The sole question now before the court is whether the petition stated a cause of action.
The Board of Education in its petition alleged that it was the owner of the described real estate in Dickinson county in fee simple and was in possession thereof; that it had been in open and adverse possession of the real estate for more than fifteen years under and by virtue of a deed dated December 11, 1905, from Bert L. Thompson and Edith M. Thompson, then husband and wife.
A copy of the deed was attached to the petition as an exhibit, and it is shown that the granting clause thereof reads in part as follows:
"All of Block Number Ten (10) in Thompson's Addition to the City of Herington, to be occupied and used by said party of the second part its successors and assigns, for public schools as provided by the laws of the State of Kansas now in force or hereafter to be enacted, and for no other purpose."
The petition of the Board of Education contains the following concluding paragraph preceding the prayer:
"The above named defendants, and each of them, claim some title, estate or interest in or lien upon the real estate above described, adverse to the plaintiff, the exact nature of which claim is unknown to the plaintiff, but none of the said defendants have any title, estate or interest in the said real estate, or lien thereon, and said claims are void and wholly inferior and junior to the title and right of possession of the plaintiff to said real estate and constitute a cloud upon plaintiff's title."
Among the opening paragraphs of the brief of the appellants in this court, we find the following:
"The attention of the court is especially invited to the fact that the only parties to this suit are the grantee and the heirs of the grantor of the deed to be construed, and that the grantee seeks to quiet title for all purposes against its grantor."
The very evident trouble with the above statement at the very outset is that these facts do not appear on the face of the petition. While these demurring defendants are named in the petition, neither *622 their identity nor any right or claim of title belonging to them is disclosed in the petition. Instead, the petition in effect asks that defendants answer and set up any claim of title which they may have to the real estate in question.
One of the oldest and best settled rules of pleading is that a demurrer will reach only facts which appear in the pleading demurred to. If certain facts are necessary for the court to consider in passing upon a question of law and are not contained in the petition, a defendant must answer and allege the pertinent and necessary facts. This rule was better understood perhaps, or at least was fraught with more danger to the party demurring before the enactment of the provisions of the civil code allowing defendant to plead over after the overruling of a demurrer to the petition. Yet, even in modern practice, ill-advised demurrers waste time of the parties and the courts, and increase the cost of litigation.
One of the first cases in which this court discussed the rule that a demurrer reached only the facts appearing on the face of the petition appears to have been Mayberry v. Kelley, 1 Kan. 116. The same principle has been reiterated many times since the Mayberry case. A few of the later cases may be mentioned: Winfield Town Co. v. Maris, 11 Kan. 128; Northrup v. Willis, 65 Kan. 769, 70 Pac. 879; Manufacturing Co. v. Keckley, 77 Kan. 797, 90 Pac. 781; Riverside v. Bailey, 82 Kan. 429, 108 Pac. 796; Runnels v. Montgomery Ward & Co., 165 Kan. 571, 195 P.2d 571; Lee v. Beuttel, 170 Kan. 54, 223 P.2d 692; Kendall v. Elliot, 177 Kan. 630, 281 P.2d 1088; Anderson Cattle Co. v. Kansas Turnpike Authority, 180 Kan. 749, 308 P.2d 172; Kleppe v. Prawl, 181 Kan. 590, 313 P.2d 227; Snedeger v. Schrader, 183 Kan. 725, 332 P.2d 586.
From the outline of the petition in this case it would seem almost too obvious for argument that a cause of action to quiet title as to plaintiff's interest in the real property is stated (Cessna v. Carroll, 178 Kan. 650, 654, 290 P.2d 803; Seaton v. Escher, 86 Kan. 679, 121 Pac. 907). While the question is not really here, we might point out in passing that even if defendants were able to raise the question of plaintiff's title under the granting clause of the deed, as set out supra, a demurrer would be the wrong method of raising the question. Defendants claim only that the language of the deed places some sort of a limitation upon plaintiff's title. It is conceded that plaintiff is entitled to have its title quieted to the property as long as it is used for school purposes. In Coolbaugh, Trustee, v. Gage, 182 Kan. 145, 319 P.2d 146 the opinion reads in part:

*623 "In connection with all questions involved it is to be noted, and must be kept in mind, that under all our decisions the fact a petition seeks to recover more or different relief than that to which the plaintiff is entitled does not make it subject to demurrer if it otherwise states a cause of action (citing authorities)." (page 149.)
A demurrer is an efficient pleading tool, where a petition is fatally defective in stating any cause of action or where all the facts are stated in the petition, and the question of whether a cause of action is alleged depends upon a dispute of law. The case at bar is not within the above category, and it is evident that the trial court did not err in overruling the demurrer to the petition herein. The order of the district court should be affirmed.
It is so ordered.
