
232 Cal.App.2d 337 (1965)
In re ELVRY STONEHAM on Habeas Corpus.
Crim. No. 4819. 
California Court of Appeals. First Dist., Div. One.  
Feb. 17, 1965.
 Edward T. Mancuso, Public Defender, and James G. Magee, Deputy Public Defender, for Petitioner.
 Thomas C. Lynch, Attorney General, Albert W. Harris, Jr., and Derald E. Granberg, Deputy Attorneys General, for Respondent.
 BRAY, J.  [fn. *]
 Petitioner seeks a writ of habeas corpus to release him from custody. *338
 Questions Presented
 1. May a ward of the juvenile court, returned to it pursuant to section 1756.5, Welfare and Institutions Code, be dealt with as a "mentally disordered sex offender"? ( 5500 et seq.) Corollary to this is the question: Is conviction of a criminal offense prerequisite to such dealing?
 2. How may such a ward be dealt with on his return to the juvenile court?
 On December 9, 1958, petitioner (then 12 years of age) was adjudged a ward of the juvenile court on a petition alleging that he was in danger of leading a lewd and dissolute life. He was then committed to the Youth Authority. Petitioner was paroled by the Youth Authority but subsequently, through a series of parole violations, he was returned to the Youth Authority on October 31, 1963. Pursuant to section 1756.5, Welfare and Institutions Code,  [fn. 1] the Youth Authority found petitioner to be a mentally disordered sex offender, and returned petitioner to the committing juvenile court.  [fn. 2] On May 26, 1964, Judge Cronin, presiding in the juvenile court, ordered proceedings in juvenile court adjourned and petitioner certified under section 5500 et seq. to the superior court for hearing as a mentally disordered sex offender. On June 9 a hearing was held in superior court. Petitioner was adjudged a mentally disordered sex offender and was committed to Atascadero State Hospital as such for a 90- day observation, diagnosis and report as provided in section 5512.
 On September 3, 1964, in superior court, pursuant to the recommendation of the superintendent of the Atascadero State Hospital and on "other evidence adduced", petitioner was committed as a mentally disordered sex offender to the Department of Mental Hygiene for placement in Atascadero State Hospital until further order of the court. Thereafter, pursuant to section 5512.5, petitioner demanded a jury trial upon the issue of mentally disordered sex offender. As a result of this demand, the superior court on September 17 ordered that the sheriff take petitioner from Atascadero Hospital and deliver him to the court for further proceedings. Petitioner is now in custody of the sheriff. The jury trial demanded is awaiting the outcome of this proceeding.
 Petitioner was 17 at the time he was last returned to the *339 Youth Authority October 31, 1963. He has never been remanded to the criminal department of the superior court under section 707.
 1. A Juvenile as a Mentally Disordered Sex Offender.
 Petitioner contends that he cannot come within the provision of chapter 4, section 5500 et seq. (the provisions which deal with mentally disordered sex offenders) because he has never been convicted of a crime. Section 503 provides: "An order adjudging a minor to be a ward of the juvenile court shall not be deemed a conviction of a crime for any purpose, nor shall a proceeding in the juvenile court be deemed a criminal proceeding."
 Petitioner was returned to the juvenile court by the Youth Authority pursuant to section 1756.5 after having been committed to the Atascadero State Hospital for 90 day's observation. He was adjudged a mentally disordered sex offender (a sexual psychopath) both at the hospital and by the Youth Authority.
 Section 1756 provides: "No person under the control of the [Youth] authority shall be transferred to any state hospital or institution for the mentally deficient or mentally ill, except for observation, diagnosis and such treatment as the hospital or institution finds necessary during such period, unless such person is committed to such hospital or institution in accordance with the procedure prescribed in the Welfare and Institutions Code." Thence follows section 1756.5 which provides in pertinent part: "Whenever the authority finds that any person committed to the authority is ... a sexual psychopath, ... the authority may return the person to the committing court for ... recommitment in accordance with law to the Department of Institutions for placement in the appropriate State institution." (Italics added.)
 It was pursuant to these sections that the Youth Authority returned petitioner to the juvenile court.  [fn. 3]
 The problem is--what is meant by the phrase "recommitment *340 in accordance with law to the Department of Institutions for placement in the appropriate State institution"? (Italics added.) Certainly the Legislature did not intend the anomalous situation, as contended by petitioner, that a person like petitioner who has already been adjudged a sexual psychopath by both the Youth Authority and the Atascadero State Hospital,  [fn. 4] found dangerous to the public and in need of psychiatric treatment, should either be released entirely or placed in a correctional institution, as in the case of a ward having no mental problems, where no such treatment is available and where the other inmates would be exposed to him.
 Here, the judge of the juvenile court and the judge of the superior court  [fn. 5] followed the procedures outlined for mentally disordered sex offender. ( 5500 et seq.) Unfortunately, however, that procedure applies only "When a person is convicted of any criminal offense, whether or not a sex offense, the trial judge ... if it appears to the satisfaction of the court that there is probable cause for believing such a person is a mentally disordered sex offender. ..." the judge may then certify the convicted person to the superior court for determination of whether he is a mentally disordered sex offender and whether he should be placed in a suitable psychiatric facility maintained by a county or in a state hospital of the Department of Mental Hygience. (See  5501.)
 [1] There appears to be no provision in section 5500 et seq. which would be applicable to a ward of the juvenile court. A juvenile court proceeding is not a criminal proceeding nor is a ward of that court considered convicted of a crime. ( 503.)
 [2] That the sexual psychopath procedure is only intended to apply to persons convicted of criminal offenses appears from a further examination of section 5501 and following sections. As shown, the section starts out "When a person is convicted of any criminal offense ...." Its next paragraph deals with "a person convicted of a sex offense involving a child" (italics added), which is a misdemeanor. Its third paragraph deals with "a person ... convicted of a sex offense involving a child" (italics added) which is a felony. *341 Section 5500.5 provides that the chapter shall not apply to a person sentenced to death nor to any person ineligible for probation, but does apply to a person convicted of an offense the punishment for which may be death, after a sentence other than death has been imposed. (Italics added.)
 Section 5501.5 provides the form of certification to be used in proceedings under 5501. The certificate states, inter alia, "... it appearing to the satisfaction of the court that the above-named defendant has been convicted of a criminal offense, to wit, violation of __________ of the State of California ...." (Italics added.)
 Section 5503.5 refers to a report to be made by the probation officer which shall "furnish to the psychiatrists pertinent information concerning the circumstances surrounding the crime. ..." Section 5512 provides for his return "to the court in which the criminal charge was tried" in the event that the medical superintendent of the hospital to which the person is sent pursuant to the preceding sections finds the person is not a mentally disordered sex offender. (Italics added.) Sections 5517, 5518, and 5519 contain similar language.
 Thus, the above-mentioned sections clearly show that conviction of a criminal offense is a sine qua non for procedure under the chapter.
 2. The Juvenile Court and Its Ward.
 [3] This, then, brings us to the question of what is the proper procedure where a juvenile is returned to the juvenile court pursuant to section 1756.5? The juvenile is still a ward, and to recommit him "in accordance with law to the Department of Institutions for placement in the appropriate institution" must necessarily mean in accordance with the Juvenile Court Law. Obviously, the Youth Authority having determined, in effect, that its correctional institutions are not the proper place for petitioner, the type of institutions appropriate for petitioner's placement is one of the state mental institutions. We then turn to the provisions of the juvenile law to determine what proceedings the juvenile court judge should have followed when petitioner was returned to the juvenile court, having in mind the provisions of section 502 which provides, in part, "The purpose of this chapter [the Juvenile Court Law] is to secure for each minor under the jurisdiction of the juvenile court such care and guidance, ... as will serve the spiritual, emotional, mental, and physical welfare of the minor and the best interests of the State ... *342 removing him from the custody of his parents only when his welfare or safety and protection of the public cannot be adequately safeguarded without removal. ... This chapter shall be liberally construed to carry out these purposes." (Italics added.)
 As stated, petitioner was returned by the Youth Authority to the juvenile court under the authority of section 1756 and also of section 779 which provides in pertinent part: "before any inmate of a correctional school may be transferred to a state hospital, he shall first be returned to a court of competent jurisdiction, and, after hearing, may be committed to a state hospital for the insane in accordance with law." (Italics added.)
 Section 1756.5 refers to "recommitment in accordance with law to the Department of Institutions for placement in the appropriate State institution." (Italics added.)
 Section 703 provides that if the juvenile court after finding that the minor is a person coming within its jurisdiction "is in doubt concerning the state of mental health or the mental condition of the person, [it] may continue the hearing and commit the person to the Department of Mental Hygiene for placement in a state hospital or state home for the mentally deficient for an indeterminate period [not exceeding] 90 days, for observation of the mental health or the mental condition of the person and recommendations concerning his future care, supervision and treatment." The medical superintendent of the state hospital or home in which the minor is placed must within the 90 days limit submit to the juvenile court "a report on the state of his [the minor's] mental health or mental condition which shall include a diagnosis of the nature of his mental illness or disability, if any, and recommendations concerning his future care, supervision and treatment."
 Although not specifically spelled out, it is obviously the intent of section 703 that if this report recommends further treatment in a state mental hospital or home, then the juvenile court directs the filing in the superior court of "a petition for the commitment of a minor to the Department of Mental Hygiene for placement in any state institution." Section 703 then provides for suspension of the juvenile court jurisdiction while the minor is subject to the jurisdiction of the superior court or under commitment ordered by that court.
 Section 5040 provides: " 'Mentally ill persons' means persons who come within either or both of the following descriptions: *343"
 "(a) Who are of such mental condition that they are in need of supervision, treatment, care, or restraint."
 "(b) Who are of such mental condition that they are dangerous to themselves or to the person or property of others, and are in need of supervision, treatment, care, or restraint." Obviously, a person who is a "mentally disordered sex offender" comes within the definition of a "mentally ill person" and may be dealt with as prescribed in the sections of the Welfare and Institutions Code, section 5047 et seq., dealing with such persons.
 Section 5047 provides, in pertinent part, "Any person may file in the superior court a verified petition, alleging that there is in the county a person who is mentally ill and in need of supervision, care, or treatment, and asking that examination be made of the mental health of the person, and that provision be made for the welfare of the person as provided in this chapter."
 "When no relative, friend, or other person can be found in the county who is able and willing to make and file the petition herein provided, any ... probation officer ... may make and file the petition herein provided. ..."
 The procedure which should be followed in the case at bench is for the superior court to return petitioner to the juvenile court. Thereupon that court should follow the procedure outlined in section 703. In view of the fact that the reports and recommendations of the medical superintendent of the Atascadero State Hospital after two periods of 90-day observation accompany the referral of petitioner to the juvenile court by the Youth Authority, it should not be necessary to again send petitioner to a state hospital for another 90-day observation. The juvenile court should direct the probation officer if "no relative, friend or other person" is able and willing to do so, to file the petition provided for in section 5047, and thereafter the proceedings provided by that and the following sections should be followed.
 Let a writ issue discharging petitioner from the custody of the superior court upon its transferring him to the juvenile court for proceedings as outlined herein.
 Sullivan, P. J., and Molinari, J., concurred.
NOTES
[fn. *]  *. Retired Presiding Justice of the District Court of Appeal sitting under assignment by the Chairman of the Judicial Council.
[fn. 1]  1. All code references, unless otherwise noted, are to Welfare and Institutions Code.
[fn. 2]  2. The record does not disclose the date of this return but it was early in May 1964.
[fn. 3]  3. The Youth Authority found petitioner to be a "mentally disordered sex offender." Section 5500 provides in pertinent part: "As used in this chapter, 'mentally disordered sex offender' means any person who by reason of mental defect, disease, or disorder, is predisposed to the commission of sexual offenses to such a degree that he is dangerous to the health and safety of others. Wherever the term 'sexual psychopath' is used in any code, such term shall be construed to refer to and mean a 'mentally disordered sex offender.' " Thus a "mentally disordered sex offender" is a "sexual psychopath" and subject to the provisions of section 1756.5.
[fn. 4]  4. In this case, there are two adjudications by the Atascadero Hospital, one on the transfer of petitioner to it by the Youth Authority, and the other on transfer by the superior court. In addition, at a hearing in the superior court, petitioner was adjudged a mentally disordered sex offender by two psychiatrists appointed by the court.
[fn. 5]  5. It was the same judge in both instances although wearing different hats and exercising different jurisdictions.
