
52 Ill. App.3d 160 (1977)
367 N.E.2d 367
THE PEOPLE OF THE STATE OF ILLINOIS, Plaintiff-Appellee,
v.
BERNARD THEIM, Defendant.  (THE DEPARTMENT OF MENTAL HEALTH AND DEVELOPMENTAL DISABILITIES, Petitioner-Appellant.)
No. 76-947.
Illinois Appellate Court  First District (3rd Division).
Opinion filed August 24, 1977.
*161 William J. Scott, Attorney General, of Springfield (William J. Fitzpatrick and Barbara A. Weiner, Assistant Attorneys General, of counsel), for appellant.
Bernard Carey, State's Attorney, of Chicago (Laurence J. Bolon and James S. Veldman, Assistant State's Attorneys, of counsel), for the People.
Reversed and remanded.
Mr. JUSTICE McNAMARA delivered the opinion of the court:
The Department of Mental Health, represented by the Attorney General, appeals from the trial court's refusal to vacate, amend, or alter its order of June 2, 1976, affecting Bernard Theim. The Department's position in this appeal is opposed by the State's Attorney of Cook County. The State's Attorney requests that we dismiss the appeal.
Theim was charged with murder. On June 2, 1976, he was found unfit to stand trial by Judge Strayhorn and was committed to the Department by Judge Strayhorn. The order of commitment contained the following six paragraphs which are challenged by the Department in this appeal:
"5. That such treatment shall continue until such time as the petitioner-defendant shall have recovered from his mental illness to the extent that he is fit to stand trial, and the Department of Mental Health shall so certify.
6. That no finding of not in need of mental treatment pursuant to a Civil hearing specified in the Mental Health Code (Chapter 91 1/2, Section 1-1, et seq.) will relieve the Department of Mental Health from its obligation to treat the petitioner-defendant for his mental illness and such treatment shall continue until medical personnel assigned to the Department of Mental Health are prepared to state that defendant-petitioner is now fit to stand trial.
7. That such treatment by the Department of Mental Health shall continue until such time as petitioner-defendant is relieved of his mental disability and is fit for trial on the pending criminal indictment.
8. Prior to the holding of any Civil hearing pursuant to statute *162 touching upon the question of further need for hospitalization or mental treatment the Department shall notify the committing criminal court as to the date of such Civil hearing and shall no later than 72 hours prior to such hearing transport the petitioner to the Psychiatric Institute of Cook County for examination by the state of such institute.
9. Notice of such Civil hearing shall be served on the Psychiatric Institute of the Circuit Court of Cook County at the same time as petitioner is brought to their offices as aforesaid.
10. When said Petitioner recovers from said unfitness, that the Department of Mental Health communicate with the Sheriff of Cook County and arrange with said Sheriff to transfer custody of said Petitioner to said Sheriff, who shall thereupon keep said Petitioner in custody upon the instant indictment until said indictment is disposed of or until said Petitioner is discharged by operation of law."
On June 23, 1976, after conducting a hearing, Judge Collins sitting in the county division of the circuit court of Cook County adjudicated Theim not to be in need of hospitalization and ordered him discharged from the Department. As we have noted, the Department then sought to vacate or amend Judge Strayhorn's earlier order. When the court refused, the Department brought this appeal.
 1 The Unified Code of Corrections (Ill. Rev. Stat. 1975, ch. 38, par. 1005-2-2(a)) provides as follows:
"(a) If the defendant is found unfit to stand trial or be sentenced, the court shall remand the defendant to a hospital, as defined by Mental Health Code of 1967, and shall order that a hearing be conducted in accordance with the procedures, and within the time periods, specified in such Act. The disposition of defendant pursuant to such hearing, and the admission, detention care, treatment and discharge of any such defendant found to be in need of mental treatment, shall be determined in accordance with such Act. If the defendant is not ordered hospitalized in such hearing, the Department of Mental Health and Developmental Disabilities shall petition the trial court to release the defendant on bail or recognizance, under such conditions as the court finds appropriate, which may include, but need not be limited to requiring the defendant to submit to or to secure treatment for his mental condition."
In People ex rel. Martin v. Strayhorn (1976), 62 Ill.2d 296, 342 N.E.2d 5, the court stated at pages 301-302:
"The language of Section 5-2-2 is clear, and the commentary *163 thereto supports the obvious intent of this statute. If a defendant, who previously has been found unfit to stand trial, is determined not to be "in need of mental treatment", as that term is defined in Section 1-11 of the Mental Health Code, and does not therefore require hospitalization, Section 5-2-2(a) dictates that he be released on bail or recognizance."
More recently, in People v. Ealy (1977), 49 Ill. App.3d 922, this court thoroughly discussed comparable issues present in the instant appeal. There a jury in the criminal court found a defendant unfit to stand trial on a robbery charge. Subsequently a judge in a civil commitment proceeding found defendant not to be in need of mental treatment. The Department thereupon petitioned the judge in the criminal division to release the defendant on bail or recognizance. The trial judge set bail, but frankly stated that he was setting bond in an excessively high amount because he believed defendant to be dangerous. This court remanded the cause for a new hearing on bail and also vacated the trial court's refusal to grant the Department's motion to vacate, amend or alter the trial court's earlier order. In so doing, this court stated that once it became apparent that defendant was neither fit for trial nor committable, the judge in the criminal division had to comply with section 5-2-2(a). That section states that if an unfit defendant is not ordered hospitalized as a result of the civil commitment hearing, the Department is to petition for his release on bail or recognizance under any conditions which the court finds appropriate. (Ill. Rev. Stat. 1975, ch. 38, par. 1005-2-2(a).) We conclude that under the holdings of Martin and Ealy and as shown by the clear intent of the statute, the court erred in the present case in not vacating, altering or amending its order of June 2, 1976. We further direct the trial court to conduct a hearing on the Department's petition to release the defendant on bail or recognizance.
 2, 3 The holding in Ealy is also dispositive of the State's Attorney's contention that the appeal should be dismissed because the Department is not a proper party appellant and because the order itself is not final and appealable. In Ealy the court recognized the Department as having standing to appeal, and the correctness of that holding appears logical to us. The Department is specifically affected by the order and is mandated by the trial court to perform certain acts. As to whether this order is final and appealable, the court in Ealy stated: "As to the Department, therefore, in this litigation, the trial court's denial of its motion should be considered a final order. The order disposed of the Department's rights upon a definite and separate part of the controversy." We, therefore, deny the State's Attorney's motion to dismiss the present appeal.
For the reasons stated, paragraphs five through ten of the circuit court *164 of Cook County's order of June 2, 1976, are vacated, and the court is further directed to conduct a hearing on the Department's petition to release the defendant on bail or recognizance.
Order reversed and cause remanded.
SIMON, P.J., and McGILLICUDDY, J., concur.
