This is a petition for a writ of habeas corpus. Facts: September 28, 1959, petitioner was charged in Wind-ham County Court, State of Vermont, with burglary, larceny, rape, and assault with intent to kill. He was found not guilty of the charges by reason of insanity and was committed to the Vermont State Hospital.
On or about December 16,1965, he escaped from the hospital and came to California, locating in Santa Clara County. He married shortly after his escape.
March 25, 1966, petitioner’s wife filed a petition in the superior court, under section 5551 of the Welfare and Institutions Code, alleging that he was a mentally ill person as described in section 5550.
The petition alleged that he escaped in December 1965 from the Vermont State Hospital, where he had been confined as criminally insane; that on March 21, 1966, he administered to his wife an overdose of Seconal tablets in an attempt to kill her; and that he was a danger to himself and others. The petition recommended that he be confined to the Agnews State Hospital.
The superior court, pursuant to section 5554 of the Welfare and Institutions Code, ordered his immediate detention for examination and hearing; and in compliance with the court’s order, he was apprehended and taken to Agnews State Hospital.
*235As he had a right to do (Welf. & Inst. Code, § 5560), petitioner demanded a hearing, and a hearing was set for April 7, 1966. The order fixing the time and place for hearing and examination directed that petitioner be detained at the Psychopathic Ward, Agnews State Hospital, until the hearing and examination.
The Department of Mental Hygiene commenced an investigation to determine whether petitioner was a nonresident who should be returned to the state of his legal residence under the provisions of section 4119 of the Welfare and Institutions Code.
March 29, 1966, the department instructed the superintendent and medical director of Agnews State Hospital to return petitioner to Vermont, and arrangements were made for the transfer to take place April 12,1966.
April 7,1966, at the request of the hospital superintendent, and over petitioner’s objection, the hearing set for that date was continued to April 14, 1966, it being the admitted intention of the superintendent to return petitioner to Vermont on April 12,1966, thus depriving him of an opportunity to have a hearing in the commitment proceeding.
Petitioner thereupon filed in the superior court a petition for a writ of habeas corpus, alleging that he was being illegally restrained of his liberty and involuntarily confined in Agnews State Hospital; that the hospital superintendent, without legal authority, intended to transport him to Vermont; and that he was being denied his right to a hearing under section 6724 of the Welfare and Institutions Code as an escapee from a public mental hospital.
April 11, 1966, a hearing was held in the habeas corpus proceeding. Emmett B. Litteral, M.D., assistant superintendent at Agnews State Hospital, testified that petitioner was admitted to the hospital March 25, 1966. He stated that he had received, through the transfer officer of the Department of Mental Hygiene, a telegram from the Attorney General of the State of Vermont, dated March 29, 1966, advising that petitioner was an escapee from a mental hospital in that state. He further stated that arrangements had been made to return petitioner to Vermont.
Dr. Litteral said that on April 7, 1966, a staff hearing was conducted at the hospital, and that, from a medical diagnosis, it was concluded that petitioner was not mentally ill as defined by California law.
*236At the hearing, the district attorney stipulated that no proceeding under section 6724 of the Welfare and Institutions Code would be instituted, and argued that the Department of Mental Hygiene was authorized under section 4119 of the Welfare and Institutions Code to transfer petitioner to Vermont.
Petitioner was not returned to Vermont on April 12, 1966, as originally planned, and is still being detained at Agnews State Hospital. No hearing has been held on the petition of mental illness filed against him, however, further continuances having been granted pending a determination in the habeas corpus matter filed in the superior court.
On April 28, 1966, petitioner moved to dismiss the commitment proceedings, but the court, without ruling on the motion, continued the matter sine die. There has been no further action in those proceedings.
Questions: First. Does section 4119 of the Welfare and Institutions Code authorize the Department of Mental Hygiene to return petitioner to Vermont at this time ?
No. Section 4119 of the Welfare and Institutions Code provides, in part: “The Department of Mental Hygiene shall investigate and examine all nonresident persons who are confined in, admitted, or committed to any state hospital for the mentally ill or mentally retarded, and shall cause such persons, when found to be nonresidents as defined in this chapter, to be promptly and humanely returned under proper supervision to the states in which they have legal residence. The department may defer such action by reason of a patient’s medical condition. ’ ’
The term ‘ ‘ confined in, admitted, or committed to any state hospital,” as used in section 4119, relates to confinements, admissions, or commitments under part 1.5 of division 6 of the code.
In chapter 1 of such part (Welf. & Inst. Code, §§ 5500-5725), entitled “Judicial Commitments,” provision is made for the commitment of persons to the state hospitals by court order.
Under chapter 2 (Welf. & Inst. Code, § 5880), entitled “Emergency Apprehension,” an allegedly mentally ill person may in certain eases be apprehended and then admitted and detained in a state hospital, without a court order, for a limited period.
Chapter 3 (Welf. & Inst. Code, §§ 6000-6033), entitled “Admission on Certification,” provides for admission to a' *237state hospital in certain cases on the application of the local health officer or, for a period not to exceed 90 days, on the application of a member of the person’s family or certain other persons. In each instance, the application must be accompanied by the certificates of two physicians.
Chapter 4 (Welf. & Inst. Code, §§ 6050-6076), entitled “Other Types of Confinement Without Court Order,” relates to voluntary admissions and transfers from other jurisdictions.
No notice or hearing is required under the provisions of the chapter dealing with emergency apprehensions. Anyone apprehended thereunder, however, must be discharged within 72 hours “unless a petition of mental illness is presented to a judge of the superior court and the court issues an order for detention of such person, or unless the person is admitted as a patient under any other provision of law.” (Welf. & Inst. Code, § 5880.)
When proceedings are commenced under any of the other three chapters, the person against whom they have been instituted is entitled to notice of the allegations made against him and an opportunity to oppose them, such rights being essential ingredients of a fair proceeding. (See Spector v. Superior Court, 55 Cal.2d 839, 843 [3] [13 Cal.Rptr. 189, 361 P.2d 909].)
In the present case, a petition was filed March 25, 1966, by petitioner’s wife under section 5551 of the Welfare and Institutions Code to have him committed by court order to a state hospital for the mentally ill.
The same day, an order was issued by a superior court judge finding that petitioner was sufficiently mentally ill and in need of supervision, treatment, care, or restraint that an examination should be made into the state of his mental health and a hearing held, if demanded, to determine the supervision, treatment, care, or restraint, if any, necessary for his best interest and protection and the protection of the people.
Petitioner demanded a hearing, and a hearing was set; but, as hereinabove indicated, no hearing has been held, and the commitment proceedings have been held in abeyance. As a result, it is conceded that petitioner has not been “committed ” to a state hospital.
The Attorney General argues, however, that petitioner has been “admitted to,” and is “confined in,” such a hospital. Although this may be literally true, petitioner is not being held in the hospital as the result of proceedings taken against *238him under the sections of the code relating to admissions or confinements, and it is in that sense that the terms are used in section 4119 of the Welfare and Institutions Code.
It would be unreasonable to suppose that the Legislature intended that any nonresident should be returned to the state of his residence under section 4119 of the Welfare and Institutions Code as a mentally ill person, at great expense to the taxpayers, without a prior determination that by reason of his mental condition he was in need of supervision, treatment, care, or restraint and should be confined in a state hospital for the mentally ill. (See Welf. & Inst. Code, § 5550.)
Furthermore, from the language of the code and the orders under which petitioner is being held at the hospital, it is clear that he is not being “confined” in a state hospital, and has not been “admitted” to such a hospital, within the meaning of section 4119.
Section 5554 of the code provides, in part: “If it appears to the judge . . . that said person is likely to injure himself or others, the judge may issue and deliver to a peace officer or counselor in mental health of the county an order directing that the person be forthwith detained in a place designated in the order for examination and hearing as provided in this article.” (Italics added.)
The order of examination or detention under which petitioner was apprehended provides: “And it affirmatively appearing to me that said Patient is sufficiently mentally ill that said Patient is likely to injure self or others if not immediately hospitalized or detained, you are therefore commanded to forthwith detain said Patient, or cause said Patient to be detained for examination and hearing, pending the further order of the Judge, at the Agnews State Hospital, Agnew, California, and there be cared for in a humane manner as a mentally ill person and provided with any medical treatment deemed necessary to Patient’s physical well-being.” (Italics added.)
Likewise, the order fixing the time and place for hearing and examination, dated March 25, 1966, provides: “It Is Hebebt Obdebed that the alleged mentally ill person appear before this Court, at Agnews State Hospital, Agnew, California, on April 7, 1966, at 9:00 o’clock A.M., for a hearing and examination on such charge and that said mentally ill person be detained at Psychopathic Ward, Agnews State Hospital, Agnew, California, until such hearing and examination. ’’ (Italics added.)
*239Accordingly, petitioner is being merely detained at a state hospital and is not now confined in, or admitted or committed to, such a hospital within the meaning of section 4119 of the Welfare and Institutions Code. As a result, the section is inapplicable to petitioner at this time.
Second. Should the proceeding against petitioner on the petition of mental illness continue as a proceeding brought under section 67M of the Welfare and Institutions Code?
Yes. Section 6724 of the Welfare and Institutions Code provides for proceedings in the superior court against a patient who has escaped from a public mental hospital in another state and is taken into custody in this state within five years after his escape.1
Petitioner was originally taken into custody on the petition of his wife rather than under section 6724 of the Welfare and Institutions Code; but when it became apparent that, as shown by the wife’s petition, petitioner is in the class of persons specifically covered by section 6724, the district attorney should have proceeded against him under that section, and petitioner is entitled to the benefit thereof.
*240However, the pending superior court proceeding against petitioner on his wife’s petition has now reached the same stage that it would have reached if it had been commenced under section 6724 and had come to the point where, as provided in that section, “Proceedings shall thereafter be conducted as on a petition for mental illness. ’ ’
Under the circumstances, petitioner is entitled to a hearing to determine whether he is mentally ill. He is entitled to such a hearing because section 6724 requires it and not merely because he demanded a hearing on his wife’s petition of mental illness.
The Superior Court of Santa Clara County is directed to set a time, within seven days after finality of this decision, for a hearing on the petition of mental illness filed against petitioner, petitioner in the meantime to be detained in accordance with the terms of the order of examination or detention under which he was apprehended. The petition for a writ of habeas corpus is denied.
Traynor, C. J., Peters, J., Tobriner, J., Peek, J., Mosk, J., and Burke, J., concurred.
Under section 6724 of the Welfare and Institutions Code, “When any patient has escaped from any public mental hospital in a state of the United States other than California and is present in this state, ’ ’ a peace officer, health officer, county physician, or assistant county physician may take him into custody within five years after the escape. On application of the officer or physician, the alleged escapee may be detained in a county hospital or state hospital.
“As soon as possible after the person is apprehended, the district attorney of the county in which the person is present shall file a petition in the superior court alleging the facts of the escape, and requesting an immediate hearing on the question of whether the person has escaped from a public mental hospital in another state within five years prior to his apprehension. The hearing shall be held within three days after the day on which the person was taken into custody. If the court finds that the person has not escaped from such a hospital within five years prior to his apprehension, he shall be released immediately.
“If the court finds that the person did escape from a public mental hospital in another state within five years prior to his apprehension, ’ ’ the superintendent of the California hospital where he is detained may care for him, and the district attorney shall immediately present to the superior court a petition asking that he be committed to a state hospital in this state. A hearing on such petition must be held within seven days of the court’s determination that the person is an escapee subject to the section. “Proceedings shall thereafter be conducted as on a petition of mental illness. If the court finds that the person is mentally ill it shall order him committed to a state hospital in this state; otherwise, it shall order him to be released. ’ ’
If he is committed to a California state hospital, the Department of Mental Hygiene shall return him to the institution from which he escaped if the authorities there will accept him; if they refuse, he is kept in California and treated ‘ ‘ as any other person committed to the hospital as mentally ill. ’ ’