
91 Wn.2d 126 (1978)
587 P.2d 537
KENNETH NEIL HARMON, Respondent,
v.
HARLAN McNUTT, as Secretary of the Department of Social and Health Services, ET AL, Appellants.
No. 45372.
The Supreme Court of Washington, En Banc.
December 7, 1978.
Slade Gorton, Attorney General, and William C. Collins, Assistant, for appellants.
John Midgley and Richard Blumberg, for respondent.
Robert E. Schillberg, Prosecuting Attorney for Snohomish County, and Norman S. Rosenburg on behalf of Mental Health Law Project, amici curiae.
DOLLIVER, J.
Defendants appeal a summary judgment in favor of plaintiff Harmon, a prisoner at the Washington State Reformatory, and all members of the class he represents. This court entered a stay of the trial court order pending review. The facts in the case have been stipulated.
Plaintiff Harmon was adjudged guilty of taking and riding in a motor vehicle without the owner's permission and sentenced to the statutory maximum term of 10 years on April 14, 1971. He was paroled on July 23, 1975, conditioned on successful completion of a program of mental rehabilitation at Western State Hospital. Harmon entered Western State Hospital but escaped prior to completion of *128 the program. Following his escape, his parole was revoked on November 10, 1975. His term was reinstated up to 10 years.
Plaintiff has been transferred at various times and for varying periods of time to the reformatory's mental health unit. Several involuntary treatments, including injections of psychotropic medications, have been administered to plaintiff during these times.
The reformatory mental health unit provides psychiatric treatment to its patients, some of whom are persons acquitted of a crime as not guilty by reason of insanity and committed pursuant to RCW 10.77 as dangerous and in need of treatment. It also evaluates persons committed for the purpose of determining competency to stand trial and treats those judicially determined incompetent. The final category, which includes plaintiff, is that of persons convicted of crimes, sentenced to the reformatory, and subsequently transferred to the mental health unit from the reformatory population.
In response to manifestations of psychiatric disorder, plaintiff was evaluated by the reformatory psychiatrist and, based on the psychiatrist's recommendation, was transferred into the mental health unit. No emergency has been alleged or stipulated, and at no time has plaintiff been adjudicated an incompetent. Over plaintiff's objections, he was injected with psychotropic medications which, according to the psychiatrist's opinion, would serve to alleviate plaintiff's psychosis. One of the administered medications, Taractan, produced an adverse reaction in plaintiff from which he appears to have recovered in full but which he recounts as "horrifying". He had difficulty in breathing, his pulse rate elevated, and eventually he had to be placed in the shock position with vital symptoms monitored every 15 minutes.
The trial court found for plaintiff based on due process and equal protection considerations. The court stated:
It seems to the Court that due process of law dictates that these kinds of treatments not be administered to *129 prisoners, that they not be done unless the prisoner is afforded the same due process of law as a citizen would be on the outside or unless the prisoner has consented to this treatment.
... I think once having held that they have the same right as a citizen does as to due process, then I think this is where equal protection comes in, and then I think equal protection affords them the same type of proceeding that a citizen would be entitled to since a citizen on the outside is entitled to have this determined in a judicial setting.
RCW 72.68.031, which gives the Department of Social and Health Services discretion to transfer a prisoner to an institution for the care of the mentally ill, was held to be unconstitutional insofar as it permits defendants to impose on the plaintiff psychiatric treatment which is physically intrusive without affording plaintiff the procedural rights given a civilian in RCW 71.05.
The mental health unit to which plaintiff was transferred, under the terms of RCW 72.68.031, is administered separately from the reformatory. RCW 72.68.035. In fact, it is apparent from the statute that the mental health unit is not a correctional institution:

Provided, That whether a state institution or facility for the care of the mentally ill be physically located within or outside the geographical or structural confines of a state correctional institution or facility, it shall be administered separately from the state correctional institution or facility, and in conformity with its principal purpose.
RCW 72.68.035. Thus, when plaintiff was transferred to the mental health unit, it was not a transfer to another correctional facility but rather to a separate mental health facility. Cf. Meachum v. Fano, 427 U.S. 215, 49 L.Ed.2d 451, 96 S.Ct. 2532 (1976). We are mindful of defendants' arguments that there is a compelling state interest in penal administration, rehabilitation and institutional security. The State is entitled to pursue legitimate penological objections; inter- or intracorrectional transfers do not violate the due process of the Fourteenth Amendment. Meachum v. Fano, supra. Here, however, no emergency was *130 alleged and the transfer was to a mental health facility, not to another correctional facility.
When a person, prisoner or nonprisoner, is transferred to a mental health facility, what are the statutory requirements before such transfer can be effectuated? Four portions of the statutes are pertinent: (1) RCW 71.05 concerns civil commitment; (2) RCW 10.77 concerns the criminally insane; (3) RCW 71.06 relates to sexual psychopaths and psychopathic delinquents; and (4) RCW 72.68.031-.037 involve a transfer to a mental facility of a person previously confined to a state correctional institution. It is under the provisions of RCW 72.68.031.-037 that plaintiff was transferred to the mental health unit.
[1, 2] With the sole exception of RCW 72.68.031-.037, in each of these categories a judicial hearing is required before the transfer can take place. We need not address defendant's contention that there is a rational basis for classification between prisoners and nonprisoners as to the procedures to be followed in committing persons to mental health facilities. See Alter v. Morris, 85 Wn.2d 414, 536 P.2d 630 (1975). Rather, we need only to look at the treatment afforded persons who, like plaintiff, are enmeshed in and subject to the criminal justice system. Defendants do not claim a rational basis exists as to the different treatment accorded plaintiff and other persons in the criminal justice system in transferring them to a mental health facility, and we find that none exists. Equal protection of the laws under state and federal constitutions requires that persons similarly situated with respect to the legitimate purpose of the law receive like treatment. Herriott v. Seattle, 81 Wn.2d 48, 500 P.2d 101 (1972).
What, then, are the requirements under RCW 10.77 and RCW 71.06 before a person in the criminal justice system can be sent to a mental health facility? Under both provisions of the statutes, a judicial hearing, where the person is entitled to counsel, is required before transfer to a mental health facility. RCW 10.77.060-.110; RCW 71.06.020-.080. *131 Those who are transferred under RCW 72.68.031-.037 are entitled to no less.
To allow one group of persons held under the criminal justice system the protections of a judicial hearing before they are sent to a mental health facility and to deny such a hearing to another group has no rational basis, and is a denial of the guaranties of equal protection accorded under the Fourteenth Amendment and Const. art. 1, § 12. See Bresolin v. Morris, 88 Wn.2d 167, 558 P.2d 1350 (1977). With the exception noted below, while the requirement of a jury trial under RCW 71.06.070 need not be accorded plaintiff before an involuntary transfer to a mental health facility, he and others in this class are entitled to a judicial hearing, to be represented by counsel, and to examinations and testimony by qualified experts or professional persons of the prisoner's choice. The purpose of the hearing shall be to establish the existence of factual precedents which give rise to the prisoner's need for treatment within the mental health facility and to determine whether he should be transferred to such facility. In addition to other testimony, the prisoner may submit evidence as to his mental or physical sensitivity to any treatment to which it is proposed he be subjected within the facility. See RCW 10.77.020, .060, .070; 71.06.040, .080.
We affirm the trial court with the following modifications: (1) In case of an emergency, a prisoner under RCW 72.68.031-.037 may be transferred immediately to a mental health facility and treated but this must be followed promptly by a judicial hearing (compare RCW 71.05.150(3), (4); 10.77.060(1)); (2) once the prisoner has been transferred to a mental health facility, he may be subject to appropriate treatment as determined by the mental health professionals at the facility. See RCW 10.77.010(5); but see also RCW 71.05.370(7), (9). Once there has been an initial hearing authorizing the transfer, it is not necessary for a hearing to be held to authorize every kind of treatment at the facility.
*132 The judgment is affirmed subject to the above modifications.
WRIGHT, C.J., and ROSELLINI, HAMILTON, STAFFORD, UTTER, BRACHTENBACH, HOROWITZ, and HICKS, JJ., concur.
