Bishop, J.
Plaintiff alleges in her petition that she has been a resident of the defendant district since February, 1900; that she became of age in May, 1902, and that, although her parents removed from said district in September, 1902, she remained, and that her residence has been in good faith. She further alleges that after the removal of her parents she entered the public schools of the defendant district, *356and continued therein without question until in January, 1903, at which time payment of tuition was demanded of her by the school superintendent as a condition of her future attendance ; that she then went before the defendant board at a called meeting thereof, and presented her affidavit, setting forth the fact of her age and good-faith residence. She alleges that at such meeting the board formally declared her to be a nonresident of the district, and that, in consequence of such action, she has since been denied the privilege of attending the schools of said district as a free pupil. A writ commanding her reinstatement as a pupil in the schools of the district without payment of tuition was prayed for.
i. Admission at mandamus, The thought presented by the demurrer is that the court had no jurisdiction, for that the residence of plaintiff was a question of fact depending for its solution upon conditions to be ascertained and determined by the hoard; that the board having acted in the premises, an action of mandamus would not lie, and this for the reason that the remedy afforded by the law, being an appeal to the county superintendent of schools, was open to her, -and was speedy and adequate. We think the demurrer should have been sustained. Section 2804 of the Code provides that “ nonresident children and those sojourning temporarily in any school corporation may attend school therein upon such terms as the board may determine.” The fact question as to the residence of the pupil is one for the board — in the first in-. stance, at least — and in this case such question was taken up by the board, and determined adversely to plaintiff. Clearly, such finding and judgment of the board cannot be reviewed in an action of mandamus. That mandamus will lie to compel a school board to act in all cases where action is enjoined upon it by law-is not to be doubted. And where a duty, ministerial in character, and admitting of no question or qualification, is enjoined as a matter of law, the performance of such duty may be commanded in terms. Code, section 4341; Benjamin v. District Tp., 50 Iowa, 648; Newby v. Free, 72 Iowa, *357379. So, too, there are many cases where, it being made to appear that the board has exceeded its jurisdiction, or has acted in disregard of the duty enjoined upon it by law, it may be required by mandamus to retrace its steps, and to proceed thereafter in accordance with law. Clark v. Board, 24 Iowa, 266; Smith v. Ind. District, 40 Iowa, 518; Dove v. Ind. District, 41 Iowa, 689; Perkins v. Board, 56 Iowa, 476. But where the duty imposed upon the board or tribunal involves an exercise of discretion based upon facts to be found by it, mandamus will not lie, however erroneous the conclusion reached; and upon this all the authorities agree. Scripture v. Burns, 59 Iowa, 72; Sullivan v. Robbins, 109 Iowa, 235. Without question it was the right of the board in the instant ease to determine the question of the residence of the plaintiff as a condition precedent to her admission to the schools as a free pupil. The determination of this question did not depend alone upon the age of plaintiff. Of necessity other facts were to be considered. Conceding now that the board reached an erroneous conclusion, it is clear that the remedy was by a review of the facts and the judgment predicated thereon. This the law provides for in the way of an appeal to the county superintendent of schools. Code, section 2818.
g. Mandamus: demurrer. Counsel for appellee seems to think that, because the effect of the demurrer to the petition was to admit the material facts pleaded, such facts are to be taken as conclusive upon the question of the residence of plaintiff, and therefore of her right to maintain this action. But this cannot be so. It is true that for the purposes of this action the demurrer made admission of the facts pleaded, but, conceding this, we have as the situation an erroneous conclusion of the board on a question of fact, which question the law had explicitly intrusted to its determination. The board, however, was acting within its jurisdiction, and the error of judgment, as we have seen, can be corrected by appeal.
The judgment of the trial court must be and it is REVERSED.