delivered the opinion of the Court.
Certified questions from the Eastland Court of Civil Appeals. Herron Carter was adjudged insane upon a trial in the county court of Shackelford county. His mother as next friend made proper application to the county judge to have the amount of bond fixed, as provided by Article 5558, R. C. S., to the end that she might take charge of her son. The county judge denied *592the application, apparently because he deemed Herron Carter too dangerous to be safely released in charge of his mother. After such refusal the mother, on behalf of her son, filed an application for a writ of habeas corpus in the district court of Shackelford County. Upon a hearing the district court found substantially that while it would be dangerous to release Herron Carter as requested, article 5558 was mandatory. Accordingly he fixed the amount of the bond at $10,000.00 for the release as prayed; and further provided in this connection that the bond was to be approved by the judge of the court.
Sheriff Arendt, custodian of Herron Carter, and the State, acting through the county attorney of Shackelford County, have attempted to appeal. The following questions have been duly certified by the court of civil appeals:
“(1) Does this court have jurisdiction of the appeal?” If the foregoing question is answered in the affirmative, then
“(2) Is Article 5558 mandatory?”
It was early established in this state in the case of McFarland v. Johnson, 27 Texas 105, that the respondent in a habeas corpus proceeding cannot appeal from.a judgment discharging the applicant. In that case the court said:
“To allow appeals by the respondent from the judgment of the court discharging the applicant, would defeat the purpose of the writ as a speedy and prompt relief against illegal detention. If the judgment for the discharge of the applicant may be superseded by an appeal, and the writ shall only be effectual for his security after the proceeding has been reviewed in an appellate tribunal, sitting perhaps at a distant point, and holding its terms at long intervals, it may be well questioned with how much propriety we have been accustomed to boast of the writ of habeas corpus as the great palladium of personal liberty. Such a construction would render the writ, in the cases where it is the most imperatively needed, but a solemn mockery. If the judgment should not be superseded by the appeal, the appellate court would be unable effectually to correct the error of the inferior tribunal. The applicant would, probably, have passed beyond the control of the court, and no decision that it could make could, in many cases, effect his recpature or restoration to the custody from which the original judgment discharged him. (The State v. Everett, and the State v. Potter, Dudley Law Rep., S. C. 295.)
*593“The authority to grant the writ is conferred upon the court or the judge. It may be made returnable before the judge in court or at chambers; it certainly could not be insisted that an appeal by the respondent would lie from an order made upon it on a hearing before the judge in chambers. Yet, shall the accident or mere matter of convenience of hearing the proceeding in the one place or the other confer upon or deprive a party of the right of appeal? The proceeding in either case is precisely the same. It is a matter for the investigation of the judge, without the aid of a jury. The questions both of fact and law are presented alone for his consideration. Surely his judgment upon them should have the same eifect, whether rendered in chambers or in open court. (Weddrington v. Sloan, 15 B. Mon., 147.)
“The fact that the decisions of the district courts, and the judges when sitting in chambers, on applications for habeas corpus, cannot be reviewed at the instance of the respondent, may no doubt occasionally result in injuries to individuals, and in questions of public interest, such as that presented in the record before us, occasion a contrariety of decisons among the different tribunals that may be called upon to act upon it, that is much to be regretted. But these evils are but slight in comparison with the greater evil that we have seen must result from a different rule. Sound policy forbids the right of appeal being granted to the respondent, and the law has not conferred it upon him.'
“This case must be dismissed for want of jurisdiction.”
Again in Dirks v. The State, 33 Texas 227, the court denied an appeal by the respondent in a habeas corpus proceeding, saying:
“The writ of habeas corpus having been granted by the district judge in this case; and upon investigation of the judge, the prisoner having been enlarged, this court has no jurisdiction of the case, and the appeal is dismissed.”
The rule is stated in 21 Tex. Jur., pp. 482-83, as follows:
“The right of appeal is restricted to the unsuccessful applicant for the writ; the respondent, whether he be the representative of the state or another, cannot prosecute an appeal from an adverse decision. This rule applies alike in criminal and civil cases.”
*594This rule is in line with the decided weight of authority. See 10 A. L. R. 386; Baird v. Nagel, 194 Ind. 87, 142 N. E. 9, 30 A. L. R. 1319, 1322; 39 C. J. S. Habeas Corpus sec. 109; 2 Am. Jur., Appeal and Error, sec. 175.
It is contended by the respondent that McFarland v. Johnson has been implicitly overruled by Harbison v. McMurray, 138 Texas 192, 158 S. W. (2d) 284. We cannot sustain this contention. That was a case in which the relator, not the respondent, was permitted to appeal, and for that reason is not controlling here. Although some of the statements in that opinion are at variance with statements contained in the opinion in McFarland v. Johnson, the court does not purport to overrule the holding of that case denying the respondent the right of appeal; nor has that decision been overruled by any other case in this state.
The purpose of the writ of habeas corpus is to obtain a speedy adjudication of a person’s right to liberation from illegal restraint, except in the child custody cases. In the light of this purpose there is no inconsistency in permitting an appeal by a relator where there is a refusal of discharge, and denying an appeal by the respondent where the discharge is granted. The former is consistent with the purpose of the writ of habeas corpus, while the latter is in conflict with such purpose.
Another contention of the respondent is that the type of case here presented as analogous to habeas corpus proceedings to determine the right to the custody of an infant, which proceedings are subject to review in most states, including Texas. 39 C. J. S. Habeas Corpus Sec. 109; Fraley v. Martin (no wr. of error history), 168 S. W. (2d) 536. In Fraley v. Martin the respondent was allowed an appeal in such a case but the court was careful to distinguish the child custody cases from cases involving illegal restraint, saying:
“Writs of habeas corpus in divorce and change of custody of children cases are used merely to litigate the question as to the proper custody of the minors; such is not a procedure calling in question an illegal restraint of the minors who were in the custody of another, in the sense of false imprisonment. Such actions partake of the nature of a suit in equity;'the rights of the parties and the minors’ welfare are determinable as in any action.”
The present case is a procedure calling in question an illegal *595restraint of one who is in the custody of another, in the sense of false imprisonment. “Whether confinement in a mental hospital is for the purpose of treatment or not, it unquestionably constitutes deprivation of liberty.” Weihofen and Overholser, Commitment of the Mentally Ill, 24 Texas L. Rev. 307, 334. The purpose of the writ of habeas corpus in this type of case is not the same as in the child custody cases. For this reason the exception made in those special cases in permitting the respondent to appeal has no application here.
We answer the first question “No.”
In view of the negative answer to the first question, it is not necessary to answer the second.
Opinion deleivered May 12, 1948.
No motion for rehearing on file.