(concurring specially). Hnder the laws of this state, “every person imprisoned or restrained of his liberty under any pretense whatever may prosecute a writ of habeas corpus to inquire into the cause of such imprisonment or restraint, and thereby (except in the cases specified in the next section) obtain relief from such imprison*234ment or restraint if it is unlawful.” Comp. Laws 1913, § 11,359. And “the writ of habeas corpus must be granted, issued and made returnable as hereinafter stated:
“1. The writ must be granted by the supreme court or any judge thereof upon petition by or on behalf of any person restrained of his liberty within this state. When granted by the court it shall in all cases bo issued out of and under the seal of the supreme court, and may be made returnable, either before the supreme court, or before the district court or any judge of the district court.
“2. The writ may be granted, issued and determined by the district courts and the judges thereof upon petition by or on behalf of any person restrained of his liberty in their respective districts.
“When application is made to the supreme court, or to a judge thereof, proof by the oath of the person applying or other sufficient evidence shall be required that the judge of the district court having jurisdiction by the provisions of subdivision 2 of this section is absent from his district or has refused to grant such writ, or for some cause to be specially set forth is incapable of acting, and if such proof is not produced, the application shall be denied.” Comp. Laws 1913, § 11,362.
It has been said that this latter section is an innovation, and intended as an innovation, upon the old practice. “It strikes at once at the matter of repeated applications to courts of equal authority. A district court, or the judge thereof, can only grant, issue and determine the writ upon the petition of a party confined in that particular district. No other district court or judge has any jurisdiction.” Carruth v. Taylor, 8 N. D. 180, 77 N. W. 617. Neither can a party come to the supreme court in the first instance as a matter of course. “Certain facts must be shown. The judge of the district court of the district where the petitioner is confined must be absent, or must refuse to act, or for some cause to be specially set forth must be incapable of acting.” Ibid.
The question presented in this case is whether the decision of the district court denying a writ of habeas corpus is appealable.
The right of appeal is not specifically granted in any case by the Constitution of this state. Hence, under the prevailing modern rule, the appellate procedure is a matter for legislative regulation. In other words, in this state the right of appeal is a statutory right to be defined, *235limited, and regulated by the legislature. 2 Enc. Pl. & Pr. 12-21. This rule applies with full force in habeas corpus cases. Carruth v. Taylor, 8 N. D. 166, 168, 77 N. W. 617; 10 Standard Proc. 953.
Whether a decision in a habeas corpus case is a final order affecting a substantial right made in a special proceeding, or a final judgment within the purview of the statutes permitting appeals and writs of error, is a question upon which the courts have differed. 9 Enc. Pl. & Pr. 1072; 12 R. C. L. pp. 1256 et seq. It is also a question upon which the members of this court have differed. See Carruth v. Taylor, 8 N. D. 166, 77 N. W. 617. In Carruth v. Taylor this court held that a final order entered by a district court in a habeas corpus case is not appealable. This ruling was approved in State ex rel. Styles v. Beaverstad, 12 N. D. 527, 97 N. W. 548, wherein this court said: “A majority of the court, as now constituted, adhere to the ruling that an order discharging the writ and remanding the petitioner, when made by a district judge, is not an appealable order; and all members of the couid are agreed that the order of remand was not res judicata; but that relator is entitled to have his petition for a second writ upon the same facts considered by this court, notwithstanding such order of the district judge.” 12 N. D. 530. But in the subsequent case of Knapp v. Tolan, 26 N. D. 23, 49 L.R.A.(N.S.) 83, 142 N. W. 915, this court held that where the object of the writ of habeas corpus is to determine who is entitled to the custody of an infant, the decision becomes res judicata and precludes the issuance of a second writ upon the same state of facts. Under the holding in the latter case, therefore, the decision of a district court in a habeas corpus case involving the custody of an infant necessarily becomes final upon the facts existing and presented for determination in that case. As such decision becomes final as to the contending parties upon the right of guardianship and the permanent custody of such infant, it would seem to follow that an appeal will lie under the provisions of our statutes relative to appeals in civil actions or proceedings. State, Baird, Prosecutor, v. Baird, 19 N. J. Eq. 481; 12 R. C. L. pp. 1257 et seq.
The former decisions of this court are all supported by many decisions. The distinction (pointed out in Knapp v. Tolan, supra) between a case wherein the writ of habeas corpus is used strictly for the purpose of obtaining the release of one who claims to be illegally restrained of. *236his liberty and one where the object of the writ is-to determine the custody of an infant is recognized by the authorities generally. While this is true, I am by no means satisfied that this distinction was justified under our statute and the former decisions of this court. Under our statute the writ of habeas corpus is authorized only when certain conditions are shown to exist. When a condition justifying the issuance of- the writ is shown to exist, the writ should be granted. If the condition does not exist, it should be denied. The statute makes no distinction between the procedure or effect of the writ in different classes of cases. However, as already stated, this court has drawn a distinction, and while I entertain considerable doubt as to the correctness of the rule announced in Knapp v. Tolan, — in view of the language of our habeas corpus act and the former decisions of this court relative to the finality and appealability of decisions in habeas corpus cases, — I am not prepared to say that the former decision should be overruled. It is desirable that rules of procedure be certain. This is especially so in cases involving questions as important as those which arise under the habeas corpus act, and the rules of procedure as established by former decisions ought not to be departed from, but rather harmonized, if it is possible to do so. And if the rule announced in Knapp v. Tolan, supra, is to stand, then manifestly the decision of a district court in a habeas corpus case involving the custody and right of guardianship of an infant is final, and concludes substantial rights of the contending parties, and is subject to review in this court by appeal or writ of error. To deny such review would be contrary to the spirit of our laws. It seems to me, however, that there is some'danger that confusion may arise with respect to the procedure in habeas corpus cases in view of tho different decisions of this court and the provisions of our statute, and it may be desirable to clarify the situation which has arisen by legislative enactment.
Our statute on appeals provides for appeals to the supreme court only from judgments and orders of district courts and of county courfis having increased jurisdiction. But a writ of habeas corpus may be issued and a hearing in such proceeding had before one of the judges of the supreme court. In such a case there is no appeal, nor is any other mode of review provided by the statute. The question naturally presents itself, What will be the effect of an order entered by a judge of *237the supreme court in a habeas corpus proceeding which involves the custody of a child ? Manifestly, such order would not be a determination of a district court, nor would it be a determination of the supreme court. Would the order be res judicata under the ruling in Knapp v. Tolan, supra, or might another writ be issued either by the district court or the supreme court, and the same facts reinvestigated? In either case an unusual situation is presented. If the determination of a judge of the supreme court in such case is res judicata, then there is no way to review the correctness of such decision insofar as i.t is based upon the facts involved in the particular case. If it is not res judicata, then the situation is presented whereby the determination of a district judge upon a certain state of facts is final and conclusive, whereas the determination by a' judge of the supreme court upon the same facts has no binding effect whatever. This is merely illustrative of the perplexing questions which may arise in the future under our statute and the rules announced in the former decisions of this court.
As I understand the matter, there is no intention on the part of the majority members to overrule Carruth v. Taylor and State ex rel. Styles v. Beaverstad, supra. But the intention is merely to limit the rule announced in those decisions to cases wherein the writ of habeas corpus is used strictly for the purpose of obtaining the release of one who claims to be illegally restrained of his liberty. The law in this state, as established by the different decisions, therefore, is:
(.1) In cases, arising in a district court, where the writ of habeas corpus is used as a writ of liberty — that is, when it is used strictly for the purpose of obtaining the release of one who claims to be illegally restrained of his liberty, — the decision is not final. It does not become res judicata, nor is it subject to review by appeal or writ of error.
(2) But in cases (arising in the district court) where the writ of habeas corpus is used for the purpose of determining the right of guardianship and custody of an infant, the decision is final and concludes the contending parties upon the facts then existing. Such decision is res judicata, and an appeal will lie therefrom.
It should follow, also, as a matter of orderly procedure, that a judge of this court ought not to hear and determine habeas corpus eases of the latter kind. And also that cases of the latter kind ought, in the first *238instance, to be heard in the district court and brought here in the regular way by appeal.