ERICK, J.
Oh tbe 15th day of June, 1907, a complaint in due form was filed before Joseph J. Williams, a justice of the peace of Salt Lake county, charging Emil Winnovich, the respondent in this appeal, with the crime of murder. He was duly arrested upon a warrant, and taken before said justice, who regularly proceeded to examine into the charge, and on the 18th day of June, 1907, after hearing the evidence adduced thereon, found that there was probable cause to believe that the accused, Emil Winnovich, had committed the crime of murder, and entered an order or judgment requiring the accused to appear before the district court of Salt Lake county, and to that end issued a mittimus or commitment directed to the sheriff of Salt Lake county, the appellant herein, to safely keep said accused and bring him before the district court of Salt Lake county to be dealt with according to law. The appellant accordingly held the respondent in custody in the common jail of Salt Lake county by virtue of said commitment. On the 26th day of June, 1907, the respondent presented his petition to George G. Armstrong, one of the district judges of Salt Lake county, wherein he alleged that he was unlawfully restrained of his liberty, and prayed that a writ of habeas corpus issue requiring appellant to show cause why he detained the respondent and restrained him of his liberty. Appellant dnly produced the respondent in court as directed by said writ, and for cause of detention produced the commitment issued as aforesaid. On the 29th day of June following the petition was submitted to said district judge, sitting as a court, without argument. The evidence adduced at the hearing before the justice, duly certified to by him, was submitted to the court, together with the return of appellant as aforesaid. On the 9th day of July, 1907, the court granted the petition of respondent, upon the sole ground, as appears from the record, that “it does not appear to the court that there is sufficient evidence in the record to warrant the holding of defendant.” The court accordingly entered an order or judgment discharging the respondent from the custody of *348appellant, and restored respondent to liberty. From the order ór .judgment, Emery appeals.
A motion to dismiss tbe appeal is interposed by respondent upon the grounds (1) that this is in effect an appeal by the state, and-that the state has not the right to appeal in such a proceeding’: (2) that, in any event, no appeal lies from habeas corpus proceedings in this state because the. order or judgment’ of discharge is not a final judgment.
We will first examine into' the first ground urged why this appeal should be dismissed, namely, that an appeal in this case is an appeal1 by the state. This brings up> the question whether the proceedings are civil or criminal. We thinlc there is little, if any room for doubt, in view of the authorities, that the proceedings are civil, and not criminal. The purpose is to protect or vindicate a civil right. The person is restrained of his liberty, and the purpose of the whole proceeding is to have’ that liberty restored to him at the earliest possible moment. When liberty is restored, the proceeding has accomplished its purpose, and no other or further consequences follow. That habeas corpus proceedings are civil, and the reasons why they are so, are well stated by Mr. Chief Justice Waite in Ex parte Tom Tong, 108 U. S. 359, 2 Sup. Ct. 872, 27 L. Ed. 826, where he says:
“The writ of habeas corpus is the remedy which the law gives for the enforcement of the civil right of personal liberty. Resort to it sometimes becomes necessary, because of what is done to enforce laws for the punishment of crimes, but the judicial proceeding under it is not to inquire into the criminal act which is complained of, but into the right to liberty notwithstanding the act. Proceedings to enforce civil rights are civil proceedings, and proceedings for the punishment of crimes, are criminal proceedings. In the present case the petitioner is held under criminal process. The prosecution against him is a criminal prosecution, but the writ of habeas corpus which he has obtained is not a proceeding in that prosecution. On the contrary, it is a new suit brought by him to enforce a civil right which he claims, as against those who are holding him in custody under the criminal process. If he fails to establish his right to his liberty, he may be detained for trial for the offense; but, if he succeeds, he must be discharged from custody. The proceeding is one instituted by himself for his liberty, not by the government to punish him for his crime.”
*349In Cross v. Burke, 146 U. S. 88, 13 Sup. Ct. 24, 36 L. Ed. 896, Mr. Chief Justice Fuller, in passing upon the question, says: “It is well settled that a proceeding in habeas corpus is a civil, and not a criminal, proceeding.” In support of this, he cites Farnsworth v. Montana, 129 U. S. 104, 9 Sup. Ct. 253, 32 L. Ed. 616; Kurtz v. Moffitt, 115 U. S. 487, 6 Sup. Ct. 148, 29 L. Ed. 458, and the Tong Case, above quoted from. We desire also to call special attention to the case of Ex rel. Durner v. Huegin, 110 Wis. 189, 85 N. W. 1046. In the case last referred to, as in this, the sheriff took the proceedings to the Supreme Court for review from an order or judgment by the lower court discharging the prisoner. That ease is one of the best considered cases we can find upon the subject, and, as it so completely covers’the whole ground with regard to habeas corpus proceedings, we refer the reader to that case. In re Foye, 21 Wash. 250, 57 Pac. 825, In re Baker, 21 Wash. 259, 57 Pac. 827, and In re Sylvester, 21 Wash. 263, 57 Pac. S29, are also cases in which' the nature of the proceedings, the right of appeal, and kindred questions are discussed: Moreover, section 4510, Revised' Statutes 1898, defines a criminal action thus: “The proceedings by which a person charged with a public offense is accused and brought to trial and punishment, is known as a criminal action.” The section following provides that such actions shall be prosecuted .in the name of the state of Utah as a 'party against the person charged with the offense, who, the next section provides; shall be designated as defendant* The person charged, therefore, is prosecuted by and in the name of the state. While in some proceedings, in their nature, civil, the name of the state may also be used, this in ha-beas corpus proceedings, as we hope to make clear, is wholly unnecessary and of no importance.
Having thus established that a proceeding in habeas corpus is' civil, what is its character under our system of procedure? Is it a suit,, an action, or may it be classed as a ' special proceeding ? It seems to us that there can be no doubt that it belongs to what, under the Code, are termed -“special proceedings.” This is also the conclusion reached *350by tbe courts wbo decided tbe cases above cited, as well as tbe conclusion reached by many of tbe courts. Tbe conclusion is reinforced by tbe fact that tbe writ of babeas corpus, well known to tbe common law, did not receive tbe respect from tbe common-law courts its importance merited, and for that reason it was made more effective in tbe reign of Charles II by what is known as tbe “Habeas Corpus Act.” Since then, to a large extent, it has been and now is regulated by statute. 21 Cyc. 283. In modem .times habeas corpus may, therefore, be considered as a statutory proceeding, although it had its origin in tbe common law. Under tbe statute it may well be classed as a special proceeding. If it is, wbo are the parties to such a proceeding ? In referring to our Code we find that section 3627, Revised Statutes 1898, provides as follows: “Tbe party prosecuting a special proceeding may be known as tbe plaintiff, and the adverse party as tbe defendant.” Wbo prosecutes in a habeas corpus proceeding ? It is either the person restrained of bis liberty, or some one in bis behalf. He institutes the proceeding tbe same as be does any other, withot leave from any one. Against whom is it directed? Against tbe person alone wbo deprives ihe applicant of bis liberty. We thus have one wbo complains of some illegal act or acts attributed to another. We thus have a plaintiff. Tbe person against whom tbe illegal acts are alleged is tbe defendant. Tbe terms “plaintiff” and “defendant,” therefore, are as proper and as applicable in a habeas corpus proceeding as they are in any other special proceeding. Tbe plaintiff seeks to vindicate a legal right. Tbe defendant opposes plaintiffs claims. That both claim under a special law cannot affect tbe matter one way or another. By section 3303, Revised Statutes 1898, it is provided that any party to a judgment may appeal therefrom; that on- appeal th$ party appealing shall be known as appellant and tbe adverse party as respondent. It also provides that tbe title of tbe action or proceeding is not changed by an appeal. From all this it seems clear to us that a proceeding in habeas corpus is civil, that tbe applicant is tbe plaintiff and tbe party wbo restrains tbe applicant is tbe defendant. *351and that, on appeal, the one wbo appeals is the appellant, and the other the respondent. Erom this it follows that in this caso no appeal is attempted by the state, but the appeal is taken and prosecuted by the sheriff, C. Frank Emeiy, the appellant, who, it was claimed in the petition for a writ of habeas corpus, unlawfully,- restrained the respondent of his liberty. The appeal, therefore, should not be dismissed upon the first ground.
Can the appeal stand as against the second ground urged ? It is asserted that the decisions of this court in Mead v. Metcalf, 7 Utah 103, 25 Pac. 729, and In re Olasby, 3 Utah 183, 1 Pac. 852, are decisive of this question. It is true that in Mead v. Metcalf this court held that an order or judgment discharging a prisoner upon habeas corpus is not a final judgment from which an appeal will lie; and it was further held in both cases referred to that no- appeal is permissible in any event in habeas corpus proceedings. Since' those cases were decided the territorial government has been merged into a state government, and the right of an appeal is fixed in the Constitution of the state, which, so far as material here, is found in section 9 of article 8, which provides: “Erom all final judgments of the district courts, there shall be a right of appeal to the Supreme Court. The appeal shall be upon the record made in the court below, and under such regulations as may be provided by law.” The right of appeal, therefore, is a constitutional right, which cannot be interfered with by the legislature. Under the law in force when tne two Utah eases above referred to were decided the statute likewise permitted an appeal from final judgments. If, therefore, a judgment in a certain proceeding was not final under the territorial statute, it would seem that, for the same reasons, it will not be final under the Constitution. In view that the territorial court has directly passed upon the question, and for the reason that the authorities are in hopeless conflict upon the question, we should not, under ordinary circumstances, be inclined to reconsider the question, but would feel constrained to abide by the decisions of the territorial Supreme Court of which this court *352is tbe successor. Tbe ruling, however, that a judgment in .á habeas corpus proceeding is not final is based in those cases upon the ground that ,sueh a judgment is not res adjudicaba, and hence does not prevent a further proceeding of the samé character in the same court or before the same judge, or in another court, or before another judge having jurisdiction of the subject-matter. This may all be granted; and yet it does not follow that a judgment which does not finally 'estop a party .to it from proceeding again in the same manner is not, for the purpose of an appeal, a final judgment This has been decided so often that it has become elementary. This court, in a later decision entitled Honerine M. & M. Co. v. Tallerday Steel P. & T. Co., 30 Utah 449, 85 Pac. 626, has so held. Mr. Justice Straup, at page 451 of 30 Utah, page 626 of 85 Pac., states the- rule in this regardtersely and correctly in the following language:
.“It is-the termination of the particular action ■ which marks the finality of the judgment. A decision which terminates the suit, or put3 the case out of court without an adjudication on the merits, is nevertheless a final .judgment.” '
This doctrine is supported by many cases, some of which are cited by. Mr. Justice Straup and need not again be cited here. If this were not so, it, would not be permitted to appeal from a judgment granting an involuntary nonsuit, because the, judgment in such a case .does not estop, the .plaintiff from prosecuting another action for the same cause of action. The test of finality for the purpose of an appeal, therefore, is not necessarily whether the whole matter involved in the action is concluded, but whether the particular proceeding or action is terminated by the judgment. If it is, and, in order to proceed farther with regard to the same subject-matter, a. new action or proceeding must be commenced, then, as a general rule, the judgment which ends the particular .action or proceeding is final for the purposes of an appeal, if an appeal is permissible at all. Both of the Utah cases referred to have thus been greatly weakened with regard to the doctrine of finality of judgments by what is said in *353the Honerine Gase. Nor can the doctrine, as it is stated to be in the Honerine Gase, be successfully assailed. We are constrained to hold therefore that in a habeas corpus proceeding the judgment of the court which either remands or discharges the petitioner is a final judgment, notwithstanding the fact that another similar proceeding may be commenced by the petitioner if he elects to do so. If this conclusion be sound, then it would seem logically to follow that, under our Constitution, where the right of appeal is given from all final judgments, this court has no power to deny the right, but must permit the exercise thereof in all cases and proceedings.
It is argued that, although the language of a constitutional provision or a statute be such as would authorize or confer the right of appeal generally, in view that the policy of the law with regard to appeals in habeas corpus proceedings is opposed to the exercise of the right, therefore appeals in such proceedings should not be permitted by the courts under general provisions, but only when the right to an appeal is given by a special statute or by constitutional provision. This argument is based upon the theory that to permit appeals in habeas corpus proceedings destroys the effectiveness of the remedy; that it may delay the party in obtaining his liberty, the very thing that.by habeas corpus was intended to be speedily restored to him. It is urged that, if appeals are permitted, then the judgment of the court discharging the prisoner must be suspended, and the very purpose of the writ is defeated. This argument or conclusion, to our minds, assumes that to follow which does not follow. Without an express statutory provision to that effect, an appeal does not of its own force suspend the judgment in a habeas corpus proceeding. (21 Cyc. pp. 338-341.) Even in those states where an express right of an appeal is given by statute, the courts have held that the taking of an appeal does not suspend the judgment. (State v. Kirkpatrick, 54 Iowa 313, 6 N. W. 588.)
But this question is not invited in this case, and we there*354fore express no opinion upon it, except to suggest that sucb a result does not necessarily follow from the allowance of an appeal, and therefore that it is not a conclusive reason or argument against the allowance of appeals in such proceedings. Nor is the further reason that a habeas corpus proceeding may be commenced in this court and thus make an appeal unnecessary of much force. If this reason applies to habeas corpus proceedings, it should also apply to proceedings of mandamus, prohibition, certiorari, and quo warranto, all of which may be originally commenced in this court. We think no one would seriously contend that for that reason no appeal should be permitted to this court from the judgment of the district court entered in any one of the special proceedings referred to. But let us examine a little farther into the assumption that an appeal in effect would destroy the effectiveness of the writ of habeas corpus under our law as it is now in force. For this purpose, it must be conceded that, if a judgment of discharge is not final, then a judgment refusing a discharge and remanding the prisoner cannot be so. What, then would be the result, in view of our present law upon-the subject of habeas corpus proceedings? This law has been materially changed since the decisions of Mead v. Metcalf and In re Clasby were announced. Section 1069, Revised Statutes 1898, which took effect on January 1, 1898, with regard to what the petition in a habeas corpus proceeding must contain, in substance provides that it must state the name of the person who detains the petitioner and the place where detained; the cause of restraint, and that it is illegal; that the legality of the imprisonment has not already been adjudged upon a prior proceeding of the same character, and whether the application for the writ has been before made to and refused by any court or judge, and, if so> to attach a copy of the petition and the reasons of the refusal to the petition. Section 1077 provides that any court or judge disallowing a writ must append his i’easons therefor to the petition, and return both to the applicant. The petition must be verified. The statements that the legality of the petition has not been already adjudicated and the refusal of a former *355application are both essential, and without them the petition does not contain the necessary statements authorizing the issuance of the writ. If this be so, what is the natural effect of such statements? As it seems to us, it naturally must result in imposing restrictions upon petitioner in making successive applications. Is it not manifest that, if a petition is presented to one court or judge which shows upon its face that another court or judge of the same or higher grade has already passed upon the identical questions involved, in nine out of ten eases the court or judge would therefore decline to issue a new writ, or, if he did, would likely follow the judgment in the prior case unless something new was made to appear ? This in its practical effect, in most cases, would, result in but one application. If no right of appeal is given,, we would thus have the very thing which, in the minds of some of the courts, has been in the way of an appeal also stand in the way of successive applications. But there are still other reasons. Suppose a person applies for a writ which is allowed, and a hearing had upon it. Upon the hearing the court refuses a discharge from the restraint, regardless of what the cause of such restraint may be. To this the court in the case of Mead v. Metcalf and some of the other courts make answer that the applicant for the writ can apply again; that he may even come to this court and make a new application, and he may continue this until he finds some court or judge who feels more favorably inclined to grant his request. But such an applicant and all of his witnesses may be hundreds of miles distant from this court, and, in view of our judicial districts being large, may be a great distance from any other judge or court. Moreover, he may have presented his whole case in which the facts are entirely undisputed, and the whole question may be one of law merely. Must he, then, in order -to obtain the judgment of this court upon the law, constitute a new proceeding somewhere, and produce all of his witnesses or take their testimony by the expensive and often unsatisfactory method of depositions, when he already has it in another form. May not the inconvenience and costs thus entailed upon him result in prevent*356ing another application upon tbe same state of facts when by a simple appeal with a bill of exceptions containing the evidence and ruling of the court he can obtain the judgment of this court with respect to the legality of his detention ? This, it seems to us, is strictly in furtherance of the policy of the law which aims to make the writ effective, and the final result to be gained by it as speedy as possible. Upon the other hand, let us assume a case where the person charged With a crime malíes the application and is given a hearing On which the district court discharges him upon a point of law. The officer having him in charge may have in his custody a number of persons charged or contemplated to be charged with the same or some other crime, but all involving the same question of law. He thinks the district court erred in his decision in discharging the first applicant. If there is no appeal, the judgment of the district court granting the discharge certainly is final so far as that charge is concerned, and the officer of the law cannot proceed farther with that or any other case involving the same legal questions, unless he could have the law 'distinctly and authoritatively settled by the highest court. If this court agrees with the district court, no one is or can be harmed. If, upon the other hand, it does not so agree, and holds that, under the law, the detention was just and proper, then, again, no one is legally injured. It needs no argument that it is just as important to enforce the laws against criminals as it is to enforce them in favor of liberty and against illegal restraint. It is by a strict enforcement of all the laws that liberty is best protected. In view of the foregoing, is it not reasonably certain that the exercise of the right of appeal is not against the policy of the la.w which aims at making the writ of habeas corpus effective? And it in no way retards the speedy determination of the application. The argument or reason, therefore, fails that an appeal should not be allowed in such proceedings. If an appeal is in harmony with the ultimate object and purpose of the writ, and tends to.faciliate rather than hinder, both the applicant and the officers of the law in establishing legal rights, is there any reason left why *357a court should resort to nice distinctions and strained constructions to avoid appeals in such proceedings? In what we have said we do not wish to be understood as holding that an appeal lies from a mere refusal to grant the writ. Many courts where the right of appeal is expressly given by statute deny the right of an appeal from a mere refusal to issue a writ. But upon this question, like upon nearly all others in habeas corpus proceedings, the courts differ. (21 Cye. 340, notes 31, 33.) As the question is not involved in this case, however, we express no opinion upon it. We think the question with regard to appeals in habeas corpus proceedings, in view of the provisions of law in force in this state, should be treated precisely as such a question would be treated with respect to all other actions or proceedings. In view of what we have said, and for the reasons that a departure from the doctrine announced in Mead v. Metcalf and In re Clasby will in no way interfere with, or in any way involve, property rights, nor disturb any rights that could have been acquired thereunder, we have less hesitancy in overruling those cases in so far as the conclusions herein reached are in conflict with them. It follows, therefore, that the motion to dismiss must be denied.
This brings us to the merits of the case. It appears from the record and judgment of the district court that the respondent ivas discharged upon the sole ground that, in the opinion of the court, the evidence adduced at the preliminary hearing was insufficient to show probable cause to- believe that respondent was guilty of the crime charged. It is clear, therefore that the district court undertook to determine from the evidence whether there was probable cause or not. Did the court have the legal right to do this in a habeas corpus proceeding? Upon this question, again, the courts are not in harmony. As a general rule, the courts hold that on habeas corpus, in the absence of a statute conferring the right, the courts cannot go into the evidence adduced before the magistrate, but must confine the inquiry to questions of jurisdiction, and, if it be found that the magistrate had jurisdiction of the subject-matter and the person of the defendant, *358that tbe complaint stated an offense and a bearing was bad upon tbe charge and tbe mittimus under wbicb tbe accused is beld is regular, and that tbe magistrate acted witbin bis jurisdiction, tben tbe court may not discharge tbe prisoner. Some courts, under statutory provisions, have beld that tbe court may, on habeas corpus, determine whether tbe accused should be beld upon tbe evidence, and may even bear additional evidence. A distinction is also made with regard to tbe time an application for tbe writ of habeas corpus is made. If made before an indictment is returned, tbe powers of tbe court to examine into tbe evidence are greater than after indictment found. (21 Cyc. pp. 324-327, where tbe authorities are collected, and tbe different views of tbe courts stated in tbe notes.) Tbe diversity of opinion is, however $ more apparent than real. It arises out of tbe different statutory provisions applicable to habeas corpus proceedings. In habeas corpus proceedings instituted for tbe purpose of voiding a commitment issued by an examining magistrate many states have enacted statutes wbicb enlarge tbe powers of tbe judges or courts in passing upon tbe legality of tbe commitment. It is under such statutes that courts sometimes examine into the facts adduced before the magistrate and tbe preliminary examination beld by him for the purpose of determining whether tbe evidence is sufficient to warrant tbe holding of the accused who has been committed by tbe magistrate into tbe custody of tbe officer. In tbe absence of such special statutes, however, tbe courts on habeas corpus have not tbe power to review tbe evidence beard by tbe magistrate', and pass upon its sufficiency to authorize the bolding of the accused. Tbe controlling principles are well stated by Judge Cooley in bis excellent work on Constitutional Limitations (7th Ed.), p. 495,. where he says:
“In the great anxiety on the part of our Legislatures to make the most ample provisions for speedy relief from unlawful confinement, authority to issue the writ of habeas corpus has been conferred upon inferior judicial officers, who make use of it sometimes as if it were a writ of error, under which they might correct the errors and irregularities of other judges and courts, whatever their relative jurisdiction and dignity. Any such employment of the writ is an abuse. Where *359a party who is in confinement under judicial process is brought up on habeas corpus, the court or judge before whom he is returned will inquire: (1) Whether the court or officer issuing the process under which he is detained had jurisdiction of the case, and has acted within that jurisdiction in issuing such process. If so, mere irregularities or errors of judgment in the exercise of that jurisdiction must he disregarded on this writ, and must be corrected either by the court issuing the process, or on regular appellate proceedings. (2) If the process is not void for want of jurisdiction, the further inquiry will be made, whether, by law, the case is bailable, and, if so, bail will be taken if the party offers it; otherwise he will be remanded to the proper custody.”
The writ of babeas corpus cannot be made to serve tbe purpose of an appeal or writ of review,,unless some statute specially authorizes this to be done. But, even when authorized by statute, such review must be strictly limited to the special proceedings to which the statute applies. This is well illustrated by the decisions emanating from the same courts in habeas corpus proceedings. In California, where there is a special statute authorizing the courts on habeas corpus to determine whether or not there is probable cause to commit the accused on preliminary hearing by the magistrate, the Supreme Court of California hold that the courts on habeas corpus may examine into. the facts to determine whether there is any evidence that justifies the findings of probable cause by the magistrate. (People v. Smith, 1 Cal. 9.) Similar holdings based upon similar statutes are found in State v. Hayden, 35 Minn. 283, 28 N. W. 659, and other cases; but the authority to do this comes from the statute, and, where there is no statutory provision, the courts do not extend the scope of the investigation on habeas corpus so as to make the proceeding in effect one of review. This is again illustrated by the decisions of the same courts, to which we have already referred, in the following cases: State v. Kinmore, 54 Minn. 135, 55 N. W. 830, 40 Am. St. Rep. 305; Ex parte Miller, 82 Cal. 454, 22 Pac. 1113. Where the common law is in force, or under statutes which are in effect merely declaratory of the common law, the courts, on habeas corpus, may not extend the investigation beyond jurisdictional matters. The following cases, among a large num*360ber that might be cited, clearly state the rule: Turner v. Conlcey, 132 Ind. 248, 31 N. E. 777, 17 L. R. A. 509, 32 Am. St. Rep. 251; State v. Kinmore, 54 Minn. 135, 55 N. W. 830, 40 Am. St. Rep. 305; Smith v. Clausmeier, 136 Ind. 105, 35 N. E. 904, 43 Am. St. Rep. 311; Horner v. United States, 143 U. S. 570-578, 12 Sup. Ct. 522, 36 L. Ed. 266; Young v. Fain, 121 Ga. 737, 49 S. E. 731; Ex parte Perdue, 58 Ark. 285, 24 S. W. 423; Merriman v. Morgan, 7 Or. 69. There is no statutory authority in this state whereby a court or judge, on habeas corpus, may review the evidence adduced before a magistrate in support of a criminal charge for the purpose of determining whether the evidence was either competent or sufficient to warrant the magistrate in holding the accused for trial to the district court and in committing him for that purpose. The proceedings had before the magistrate in this case are not attacked upon jurisdictional grounds. There was a proper complaint which charged an offense. The magistrate had jurisdiction of the subject-matter and of the person of the accused. A hearing was had. Witnesses were sworn, and testified both for the state and the accused, and their testimony was reduced to writing. All this was in compliance with the law of this state. The commitment rpapers are not attacked. In addition to the foregoing, the transcript of all the proceedings had before the magistrate discloses that the law had been complied with in every particular. This being so, the district court who heard the habeas corpus proceeding had no authority to review the evidence heard by the magistrate for the purpose of determining its sufficiency to support the judgment or order entered by him in holding the accused to answer to the district court. In order to justify the district court to so review the evidence would require that the writ of habeas corpus be transformed to a writ of review, which, as Judge Cooley well says, would be an abuse of the writ. It is not the province of a court or judge, on habeas corpus, to determine whether in his judgment the evidence is sufficient to warrant the binding over of the accused or not. The only question in such a proceeding is: Is the accused illegally restrained of *361bis liberty? Tbe magistrate may err in bis judgment both with regard to tbe competency and tbe sufficiency of tbe evidence, but tbis alone does not make tbe restraint illegal. It would at most make it erroneous. Errors must be cured by an appeal or in proceedings provided by law and instituted for that purpose.
But tbe district court in tbis proceeding went beyond wbat tbe authorities justify even in those states where there arc special statutes permitting courts on habeas corpus to review the findings of tbe magistrate made on preliminary examinations. In those states tbe general rule is that the court or judge on habeas corpus may examine into tbe evidence for tbe purpose only of determining whether there is any legal evidence which fairly tends to support tbe findings and order of tbe magistrate. (State v. Hayden, supra; United States v. Greene [D. C.], 108 Fed. 816; In re Henry, 13 Misc. Rep. 134, 35 N. Y. Supp. 210; State v. Beaverstad, 12 N. D. 527, 97 N. W. 548; Ex parte Becker, 86 Cal. 402, 25 Pac. 9.) Tbe evidence in tbe record directly and positively connects tbe respondent with tbe shooting which it is claimed resulted in the death of the person named in tbe complaint filed with tbe magistrate. Tbis being so, tbe district court was not authorized to pass upon tbe competency of tbe evidence in a habeas corpus proceeding. „In view of tbe statutes of tbis state governing preliminary examinations and tbe fundamental principles underlying proceedings in habeas corpus, we are constrained to bold that where tbe record, certified to by tbe magistrate, affirmatively shows wbat we have stated tbe record in tbis case discloses, and there is no attack upon tbe truthfulness of tbe facts recited in tbe record, tbe court is powerless to go behind tbe judgment of tbe magistrate. If, however, tbe accused should allege and offer to prove that tbe magistrate did not in fact bear any evidence in support of tbe- charge, and tbe accused did not, with tbe consent of the state, waive an examination, and that tbe record showing tbe proceedings of tbe magistrate is false, then tbe court or judge, on habeas corpus proceedings, should-bear tbe evidence' in that regard; and, if be finds that there *362was no preliminary examination or bearing by tbe magistrate, tbe accused should be discharged.
Tbe order or judgment of tbe district court discharging tbe respondent therefore should be, and accordingly is, reversed.
McCABTY, C. J., and STBAIJP, J., concur.