
459 S.W.2d 947 (1970)
The STATE of Texas, Appellant,
v.
George G. GONZALES, Appellee.
No. 14909.
Court of Civil Appeals of Texas, San Antonio.
November 4, 1970.
Crawford C. Martin, Atty. Gen., Nola White, Alfred Walker, Robert C. Flowers, Monroe Clayton, Roland Daniel Green, III, Austin, for appellant.
Evans, Marshall, Graham & Ribak, San Antonio, for appellee.
KLINGEMAN, Justice.
Respondent, the State of Texas, appeals from a judgment of the District Court of Bexar County, Texas, releasing, petitioner, George G. Gonzales, a minor, from the custody of the Texas Youth Council in a habeas corpus proceeding.[1] Petitioner had been found to be a delinquent child in the Juvenile Court of Medina County, and was committed to the care, custody and control of the Texas Youth Council and thereafter sent to the Gatesville State School for Boys. On January 14, 1970, an order was entered by the Juvenile Court of Medina County, setting aside and dismissing the prior order of commitment. At the time this order was entered, the youth was not at Gatesville, but out as an escapee. Thereafter, in February of 1970, he was picked up and transported back to Gatesville. A writ of habeas corpus was filed on behalf of the youth by his mother on February 18, 1970; and after hearing, the court granted such writ of habeas corpus and ordered the petitioner released from the custody of the Texas Youth Council and returned him to the custody of his mother.
Petitioner has filed in this court a motion to dismiss for want of jurisdiction; and our initial inquiry is whether respondent has any right of appeal. Ordinarily, a respondent in a habeas corpus case cannot appeal from a judgment discharging the applicant. Arendt, Sheriff, v. Carter, by Next Fr., 146 Tex. 590, 210 S. W.2d 976 (1948); Dirks v. State ex rel. Jones, 33 Tex. 227 (1870); McFarland v. Johnson, 27 Tex. 105, 106 (1863); 27 Tex. Jur.2d, Habeas Corpus, § 73[2]; University of *948 Texas: Gregg, Habeas CorpusAppeal & ErrorRespondent's Right to Appeal, 27 Tex.L.Rev. 559 (1949).
Respondent concedes this to be the general rule, but asserts that the juvenile delinquent cases are an exception to this rule. Respondent has cited us no Texas authority where it has been so held, nor have we been able to find any. In support of this contention, respondent asserts two basic contentions:
(1) That Article 23381, Sec. 21, Vernon's Annotated Civil Statutes[3], either expressly or by implication, gives the State the right to appeal in any civil proceeding, including habeas corpus, which involves juvenile delinquents. From a study of the entire statute, it is our opinion that the right of appeal conferred by Section 21 to the State, applies only to actions pursuant to the provisions of Article 23381. The State of Texas did not appeal from the judgment entered in the Juvenile Court of Medina County, setting aside and dismissing the prior order of commitment.[4] The term "court" is defined in such statute as "juvenile court", and said Section 21 specifically provides that written notice of appeal shall be filed with the juvenile court. We do not think that this statute either expressly or by implication changes the settled rule in this State that a respondent in a habeas corpus case cannot appeal from a judgment discharging the applicant.
(2) Respondent also contends that this type of case is analogous to habeas corpus proceedings to determine the right to the custody of children, where respondents have been allowed to appeal. Fraley v. Martin, 168 S.W.2d 536 (Tex.Civ.App.Dallas 1943, no writ). In Fraley v. Martin, however, 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."
We think a more analogous case is that of habeas corpus proceedings in cases involving insane persons. An insane person, like a delinquent child, is not confined in an institution to punish, but rather for treatment and rehabilitation. However, in both instances, there is a type of detention, confinement, and deprivation of liberty. A good discussion of the rights of respondent to appeal in a habeas corpus proceeding is found in the case of Arendt v. Carter, supra, where the Supreme Court held that an appellate court did not have jurisdiction to hear an appeal by a respondent [the State of Texas] from an adverse decision in a habeas corpus proceeding involving an insane person. The Supreme Court stated that it was early established in this State *949 in the case of McFarland v. Johnson, supra, that the respondent in a habeas corpus proceeding cannot appeal from a judgment discharging the applicant.[5] In Arendt v. Carter, the contention was made by respondent that McFarland v. Johnson had been explicitly overruled by Harbison v. McMurray, 138 Tex. 192, 158 S.W.2d 284 (1942). In overruling such contention, the Supreme Court pointed out that Harbison v. McMurray was a case in which the relator, not the respondent, was permitted to appeal, and said: "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."
We find no merit in respondent's contentions, and this appeal is dismissed for want of jurisdiction.
NOTES
[1]  In this opinion, the State of Texas will be referred to as respondent, and George G. Gonzales as petitioner.
[2]  In general, only the unsuccessful applicant for a writ is entitled to the right of an appeal; the respondent, whether he be the representative of the State, or another, cannot prosecute an appeal from an adverse decision. This rule applies both in criminal and in civil cases.
[3]  "Sec. 21. An appeal may be taken by any party aggrieved to the Court of Civil Appeals, and the case may be carried to the Supreme Court by writ of error or upon certificate, as in other civil cases. Written notice of appeal shall be filed with the Juvenile Court within five (5) days after the entering of the order. An appeal, in the case of a child, shall not suspend the order of the Juvenile Court, nor shall it discharge the child from the custody of that court or of the person, institution or agency to whose care such child shall have been committed, unless that court shall so order. However, the appellate court may provide for a recognizance bond. If the appellate court does not dismiss the proceedings and discharge the child, it shall affirm or modify the order of the Juvenile Court and remand the child to the jurisdiction of the Juvenile Court for supervision and care, and thereafter the child shall be and remain under the jurisdiction of the Juvenile Court in the same manner as if such court had made said order without an appeal having been taken."
[4]  See McAlpine v. State, 457 S.W.2d 426 [Tex.Civ.App.Houston (1st) 1970, no writ].
[5]  The Supreme Court discussed at length the public's policy supporting the rule that respondents cannot appeal from a judgment discharging the applicant, and also discusses and distinguishes the child custody cases from cases involving illegal restraint.
