In this proceeding application is made for a writ of habeas corpus in behalf of one Alice Solberg. The trial court re-*521fuaed to issue a writ. Application is also made for certiorari as an ancillary writ.
Alice Solberg, seventeen years of age, was, by order of the juvenile court of Ward county, dated March 25, 1925, committed to the State Training School at Mandan for the period of her minority, and the superintendent of that institution was appointed guardian of her person. The order contained no statement to the effect that the minor was delinquent or that the parents were unfit, nor was it supported by findings to that effect. On March 27, an amended order of the s'ame general tenor was made and filed, but containing the' following preamble': “The above entitled matter having come on for hearing before the court upon the report of the juvenile commissioner as provided by law, the above named defendant and her parents both having been notified of final hearing and the defendant and her mother only ap-jiearing, and the court being duly advised in the premises finds that .said Alice Solberg is a juvenile of the age of seventeen years and that she is incorrigible and delinquent and it appearing that the same should be done, now therefore it is hereby ordered, etc.” The hearing to which reference is made in the orders took place on March 25, before Judge John C. Lowe, District Judge. The application for the writ of habeas corpus in the trial court was denied on the 27th of March, the date of the amended order of commitment.
It appears from the record that- complaint was first made in the form of a petition against Alice Solberg on November 10, 1924. It is there alleged by one Elizabeth Campbell, an officer attached to the juvenile court, that the girl is delinquent and that her delinquency “consists in this that she is pregnant and is a minor child under the age of eighteen.” The names and residences of the parents are given. The petition is printed. A paragraph in the printed part is as follows: “That the parent —-, custodian or guardian of said child •--unfit and improper guardian... in this, that ■ — -- he —-- appear -— to be unable - unwilling, or incompetent to properly, that is, protect, train, educate, correct, control and discipline said child.” It may be seriously doubted if this paragraph was intended be the complainant at the time as an allegation of parental unfitness. Such an allegation is essential if it be intended to take the child from the parental home without the consent of the nat-*522in-al guardians. Comp. Laws, 1913, § 11,406. Other'inappropriate printed words were stricken from the form by drawing' a line with pen and ink through them. No blanks in this paragraph were filldd by the complainant, and no other allegations are made tending to show that the parents were unfit to have the custody o£ the girl. There is also 'a printed allegation of consent to surrender of custody — not claimed by anyone to be true. On January 26, 1925, a summons was issued by Gertrude L. Lowe, juvenile commissioner, citing the alleged delinquent and her parents to appear in the juvenile court at 7:80 P. M. on January 27; attached to the summons is a certificate of Elizabeth Campbell, juvenile officer, that she served the summons on the parents on January 26, by leaving a copy with each of them.
The report and the recommendations of the juvenile commissioner, made to the district judge, show that mother and child appeared at the time and place fixed in the summons; that a conference was at that time had between Mrs. Lowe and Mrs. Solberg with the result that the commissioner, upon request, agreed to make an effort to find a home for Alice’s baby. Nothing further seems to have been done. On March 20, the day of the hearing and the date of the report of the juvenile officer to the district judge, the commissioner learned that the baby had died some days before. The officer further reports that Alice “is running around” with one Guimont the putative father of her child, and she recommends that Alice be ordered sent to the juvenile cottage at Eargo. On March 20, when the hearing was had before the juvenile commissioner, some testimony was taken; on the basis of that testimony the officer recommends that the aforesaid suggested order be made. The persons who testified are one McLaughlin, a patrol inspector with the U. S. border patrol, Mrs. Solberg, and Alice. The father did not appear at any time. There is nothing in the record to indicate that any notice whatsoever was given to the father of the hearing before the juvenile commissioner on March 20, 1925, or before the district judge on March 25, following, except the recital in the amended order that both parents were notified. The truth of this recital is positively denied. ■ =
The testimony adduced at both hearings tends to show that Alice had ran away from home twice, on one occasion to Portal, N. IX, and -on the other occasion to Minneapolis, Minn. She denied immoral «'«induct *523of any sort on either occasion 'and there is no direct testimony to the contrary. Her trip to Minneapolis is explained by apprehension and anxiety upon discovering her condition.
At the conclusion of the hearing before the district judge, the court said: “I am going to sentence you until you are twenty-one years old to the State Training School at Mandan.” Before this pronouncement, the following colloquy took place: By the Court: “Mrs. Sol-berg, have you 'anything to say? A. “They want to get married, (Guimont and Alice) and I do not think they should be married before she is of age, that will be in October.” Q. “I am talking about what we shall do with her?” A. “I think she is behaving now. I think she has a good place where she is staying.” Alice Solberg: “I don’t see why you should bother with the past as long as I am behaving.” The Court: “I am going to punish you for what you have done.” Alice Solberg: “All right, punish me, if you get any kick out of it.” The court thereupon sentenced the girl to the State Training School.
Sec. 11,411, Comp. Laws, 1913, so far as material, reads:
£Tf the court shall find any child under the age of eighteen (18) to be a delinquent within the meaning of this act, the court may allow such child to remain at its own home subject to the friendly visitation of a juvenile officer, such child to report to the court or juvenile officer with such record of its conduct in its home or school as the court may require as often as may be required, and if the parent, parents, guardian or custodian consent thereto, or if the court shall further find either that the parent, parents, guardian or custodian are unfit or improper guardians or are unable or unwilling to care for, protect, educate or discipline such child and shall further find that it ■is for the interest 'of such child and of the 'people of this state that such child he taken from the custody of its peurenis, parent, custodian or guardian, the court may appoint some proper person or juvenile officer guardian over the person of such child and permit it to remain at its home, or order such guardian to cause such child to be placed •in a suitable family home, or cause it to be boarded out in some suitable home, or the court may commit such child to any institution incorporated under the laws of this state to care for delinquent children, or to any institution that has been or may be provided by the state, *524county, city, town or village suitable for tbe care of delinquent children, etc.”
Tbe trial court made no findings of fact, except as contained in tbe amended order entered on tbe day when tbe petition for tbe writ of habeas corpus was denied. There is no finding in the record that the “parents - are unfit or improper guardians or are unable or unwilling to care for, protect, educate or discipline such child---.” § 10,411, supra. There is no finding “that it is for the interest of such child and of the people of this state that such child be taken from the custody of its parents.” Oomp. Laws, 1913, § 11,422. It is contended by the petitioner that the court was without jurisdiction to make an order sentencing the girl to a term in the Training School without a finding, not only that she was delinquent, but in addition that the par-ents were unfit, or that she could not be cared for properly in the home or under the direction of the probation or juvenile officers. We think this contention must be sustained.
It is strongly urged by the petitioner that the court was without jurisdiction because the father had no notice either of the hearing before the juvenile commissioner on March 20, or of the hearing on the report on March 25. The same objection to the proceeding was made when petitioner applied for the writ below. The statute clearly contemplates notice of the proceedings before the commissioner, and, we think, by necessary implication, of the hearing before the district judge on the recommendations of the officer. The statute provides, when the juvenile commissioner or the court believes that “a final order for the custody or control” of the child becomes necessary, or if it be deemed advisable to “deprive the parents” of the custody of the child, “that it shall be the duty of such commissioner to make findings and report the same with his recommendations to the district judge who shall fix a reasonable time and place for hearing, and make such final judgment or order in the ease as he shall deem proper and right.” Bess. Laws, 1921, § 1, chap. 83. This statute clearly contemplates notice to the parents and a reasonable opportunity to be heard before the court may make an order depriving them, perhaps permanently, of the custody of their children. Sec. 11,406, Uomp. Laws, 1913, provides that the proceedings shall be conducted “with due regard to the rights and duties of parents and others.” It is inconceiv-*525ab]e that the legislature intended to give any tribunal the power to separate parent and child without first giving the parent notice and am opportunity to be heard. The legislature in this State has not attempted to confer such power on any court or officer. The mother was present; the father did not appear. Their affidavits unequivocally deny that any notice of either hearing was given. There is no certificate or proof of service of such notice by any officer or other person; only the bare recital in the amended order. We find it unnecessary to decide or discuss this point further. We are constrained to the conclusion that the order is void for want of jurisdiction on other grounds.
It is the settled rule in this state that “upon habeas corpus the court ordinarily will inquire no further than to ascertain whether the court or officer issuing the process on which the prisoner is detained had jurisdiction of the case, and acted within that jurisdiction in issuing the process. . . . Mere errors or irregularities of procedure, not affecting the question of jurisdiction, are never reviewable on habeas corpus; and where the process is regular and valid upon its face, the inquiry will go only to the question of jurisdiction.” State ex rel. Styles v. Beaverstad, 12 N. D. 527, 531, 97 N. W. 548. “The jurisdictional inquiry, however, will extend to the power of the court or magistrate to mate the commitment. Jurisdiction to malee the judgment or order is as essential as is jurisdiction of the person and of the subject matter.” Ibid. p. 532. See also State v. Floyd, 22 N. D. 183, 132 N. W. 662; Church, Habeas Corpus, 2nd ed. § 305. The reason is that on habeas corpus the attack on the judgment is collateral. The rule is well settled, however, that if the “particular judgment in question” was entered without authority, habeas corpus will lie. 12 R. C. L. 1197; 29 C. J. 30, 31; 13 Cal. Jur. 223; Re Nielsen, 131 U. S. 176, 33 L. ed. 118, 9 Sup. Ct. Rep. 672; Ex parte Burden, 92 Miss. 14, 131 Am. St. Rep. 511, 45 So. 1; Blanchard v. Bryan, 83 Okla. 33, 200 Pac. 449; Bandy v. Hehn, 10 Wyo. 167, 67 Pac. 979, 15 Am. Crim. Rep. 395; Re Hook, 95 Vt. 497, 19 A.L.R. 610, 615, 115 Atl. 730; State v. District Ct. 35 Mont. 321, 89 Pac. 65.
The law gives parents the right to the custody of their children'. There is no express provision in the juvenile court law to this effect, but nothing therein is inconsistent with the general statutes that have been in force since early territorial days. Comp. Laws, 1913, § 4424; *526Sess. Laws, 1923, cbap. 153. Tbe amendment of 1923 gives both parents the same right in this respect and is subsequent to the Juvenile Act. It is only when it is made to appear that the parents and the parental home fail adequately to meet the responsibility of caring for the child that the State is justified in substituting itself as.its guardian. This somewhat drastic proceeding, resulting in a deprivation of the custody of the off-spring by those whose dirty and privilege, in the course of nature, it is to care for them, is justified upon the theory that it is for the best interest of the child and of the state; that the welfare of the child is the paramount question, superseding the affection and solicitude of the natural parent and displacing every sentimental consideration.
The question before this court does not relate to the regularity of the proceedings, tho that is ably and seriously challenged; it is rather one of jurisdiction in the district court, sitting as a juvenile court, to pronounce judgment or make an order transferring the custody and guardianship of a minor child from her natural parents to that of the •State, taking her from her home and putting her in a public institution under stringent regulations, without at the same time determining, finding or passing upon the qualifications, or the absence of qualifications, of the natural parents to have the care, custody and guardianship of their child.
The juvenile court law is not intended to operate as a criminal statute and it should not be so construed. Mill v. Brown, 31 Utah, 473, 120 Am. St. Rep. 935, 88 Pac. 609. Within its purview are embraced alike the defendant, the neglected and the delinquent child; there is no difference made, as to the nature of the proceedings, between the child who is delinquent and who has probably become guilty of misconduct, which, in a person of full moral responsibility, would bo considered reprehensible, and a dependent child, or one who is neglected by its parents, but free from fault of its own. All are placed in the same category, primarily under the protection and care of the family and parents, and only when they have failed, may the State itself assume their care and custody. Section 11,422 supra, discloses clearly the purpose of the juvenile court act. It is there said: “And in case of delinquency, that as far as practicable any delinquent child shall be treated, noi as a criminal, but as mis-directed and mis-guided *527and needing aid, encouragement and assistance, and if such child cannot be properly cared for and corrected in Us own home, or with the assistance and help of the probation officers, then that it may be placed in some suitable institution where it may be helped and educated and equipped for industrial efficiency and useful citizenship.” In Mill v. 33rown, supra, the Supreme Court of Utah had under consideration the validity of the commitment of a minor to the Industrial Training School. We concur fully in the holding in that case as to the conditions under which the state may substitute itself for the natural parents as guardian of the child, the fundamental purpose of the juvenile court law, and the power of the court thereunder to deprive parents of the custody of delinquent children. In no material respect do the statutes of Utah differ from ours. Speaking for the court, Justice Trick says:
“But there is another reason for which we think the judgment cannot be permitted to stand. By a careful examination of the cases above cited, it will be found that all the decisions rest upon the proposition that the state in its sovereign power has the right, when necessary, to substitute itself as guardian of the person of the child for that of' the parent or other legal guardian, and thus to educate and save the child from' a criminal career; that it is' the welfare of the child that moves the state to act, and not to inflict punishment or to mete out retributive justice for any offense committed or threatened. In other words to do that which it is the duty of the father or guardian to do, and which the law assumes he will do by reason of the love and affection he holds for his off-spring and out of regard for the child’s future welfare. The duty thus rests upon the father first. As the duty is imposed by the moral as well as the laws of society upon the father first, so it must likewise logically follow that he must be given the first right to discharge that duty. Indeed the common law based the right of the father to have custody and dominion over the person of his child upon the ground that he might better discharge the duty he owed tire child and the state in respect to the care, nurture, and education of the child. The right and duty are therefore, reciprocal, and may be termed natural, as well as legal and moral.- Before the state can be substituted to the right of the parent it must affirmatively be made to appear that the parent has forfeited his natural *528and legal right to the custody and control of the child by reason of his failure, inability, neglect or incompetency to discharge the duty and thus to enjoy the right. Section 6 of the act defines the acts which constitute a child a delinquent and thus ’a Jit subject to bo brought before', the juvenile court for examination. To bring the child before (he court, the act provides that a complaint in writing must be filed, which was done in this case. But when a complaint is filed and one 'or .more of the acts constituting delinquency are set forth the court only acquires jurisdiction of the child for the purpose of investigating into its condition or conduct. Quite true, in some states, a formal 'Complaint in writing may not be an essential, but it is made so in this state, and hence must be observed. But when the court has investigated the matters set forth in the complaint and finds some or all of the charges to be true, it does not follow, from that fact alone, that the, state should forthwith be substituted in place of the parent or legal guardian and take full control of the person of the child. All that the court has established so far is that the child is a delinquent in view of the provisions of the act. The question as to whether the parent, has hcen derelict in respect to its duty or whether he is a competent person or not to1 have charge of the child, and whether he has forfeited his natural and legal right to continue the relation, has not been touched upon, and no finding or adjudication of tbat fact has boon made. There is nothing, therefore, up to this point, in the proceedings upon which a judgment can be based substituting the state as guardian of the person of the child in place of the parent. The whole fabric of the law, as is clearly shown by all the decisions cited, supra, rests upon this theory, and those' laws are sustained by virtue of it. Until something is made to appear that the child is not cared and provided for- in respect of the matters involved, there exists no reason -for the state to take charge of the person of the child, and hence no right exists to do so under the act.”
It seems clear that the district judge misinterpreted the law and misconceived his function. It is true that the unfortunate misstep made by tbis young girl is such that under § 11,403, she might have been found delinquent; it does not necessarily, indeed, ordinarily should not, follow that she must therefore be confined in a reformatory institution, for more than three years, as a punishment, and taken from *529tbe custody, control, and care of her parents, who under the statutes owe the first duty and have the primary claim to guard, protect and console her in the presence of this the most tragic calamity that can overtake a maiden on the threshold of womanhood. Upon the record we do not deem it necessary to remand her to the custody of the local officers. Numerous affidavits .attest the fitness of the parents and the Christian character of the home surroundings. It is a matter of common knowledge that girls from homes which, by every commonly accepted standard, may be and are justly accounted the best in the land, too frequently stumble as did this unfortunate girl; it is also true that in such circumstances it would be not only unwise, but a gross and inexcusable outrage to tear tlie girl, summarily and as a matter of course, from her home and parents, and put upon her for life the brand of what would seem, to the undiscriminating, at least a quasi criminal sentence. In such a situation she is more in need of the loving sympathy and care of parents in a decent home than of such training in the arts as she may receive in a public institution for delinquent girls. Much is the judgment of enlightened humanity; and such is the purpose, the spirit and the voice of the law. The" statutes of this Htate recognize tiiat a child’s welfare is best promoted by living with parents; the home may he humble and in it poverty may abide; notwithstanding, the law says the child shall not be taken from its natural guardians unless it appears that they are unfit; that it is in immoral or unsuitable surroundings, or that “the circumstances of the family were such that moral degeneracy was feared or anticipated.” Re Kelber, 51 N. D. 698, 200 N. W. 786.
"Wo are. satisfied that the legislature intended that it must appear and the court must find as a jurisdictional pre-requisite to the power to transfer the custody of a delinquent child to the State and to commit the same to a public institution, that the parents are unfit custodians of the child, and that the child “cannot be properly cared for and corrected. in its own home, or with the assistance and help of the probation officer.” We feel justified in assuming that tbe juvenile officers of Ward county will help this girl in every good-faith effort to follow the path of virtue and honor; the whole hearted co-operation of the parents, the mother particularly, towards this end is a condition necessary to success. We hold, therefore, that the order of the trial court sen-*530fencing petitioner for a term in tbe State Training School was made wholly without jurisdiction, and is void. It follows that her detention is unlawful and the writ must issue.
It is so ordered.
OhkistiaNSON, Oh. J., and Bumac, Nuessle, and Bhídzeul, LI,, concur.