delivered the opinion of the court:
On motion of the People, at the relation of Charles H. Starkweather, Jr., leave was granted to file in this court a petition for writ of mandamus against Frank S. Righeimer, judge of the county court of Cook county, to rescind and set aside the judgment of that court adjudging relator insane. The facts shown by the petition are, that relator was on November 24, 1920, by the county court of Cook county adjudged insane and was afterwards committed to the Michell Sanitarium, in Peoria county. In June, 1922, he sued out of the circuit court of Peoria county a writ of habeas corpus. A return of the writ was made by George W. Michell, keeper of the sanitarium, and a hearing was had June 22, 1922. Relator was adjudged of sound mind and ordered to be forthwith discharged. He secured and presented in July, 1922, to the county court of Cook county, of which court respondent is the presiding judge, a certified copy of the judgment and order of the Peoria county circuit court, and filed in said court, in writing, his motion that the court rescind and set aside the order of November 24, 1920, adjudging relator insane. Respondent, as judge of the county court, denied the motion August 30, 1922, and refused to rescind and set aside the judgment of insanity. *310Respondent does not deny the facts alleged in the petition but denies it was his duty, as judge of the county court, to rescind and set aside the judgment of insanity, for the reason, his answer alleges, the circuit court of Peoria county was without jurisdiction in the habeas corpus proceeding and without jurisdiction to enter the judgment rendered in said proceeding. Relator demurred to the answer, and the cause was submitted on issues of law.
When the inquest was held in the county court on the sanity of relator a commission of two doctors was appointed by the county court to examine him. They reported he was insane and a fit subject to be sent to a State hospital for the insane, but on account of the character of his insanity, which they described, they recommended he be committed to some public or private hospital for the insane. The county court ordered him committed to the custody of his father until the further order of the court. His father subsequently placed him in the Michell Sanitarium, in Peoria county, which is governed, maintained and conducted by Dr. George W. Michell.
Section 24 of chapter 85 of Hurd’s Statutes, entitled “Lunatics,” is as follows: “Every person confined as insane shall be entitled to the benefit of the writ of habeas corpus, and the question of insanity shall be decided at the hearing, and if the judge shall decide that the person is insane such a decision shall be no bar to the issuing of the writ a second time whenever it shall be alleged that such person has been restored to reason; and if said person shall be adjudged sane, on presentation of a certified copy of said judgment to the county court where the inquest was had, such court shall rescind and set aside the judgment of insanity.”
Respondent contends relator was not, in fact, detained in the Michell Sanitarium at the time the habeas corpus proceeding in the circuit court of Peoria county took place, and the judgment in that proceeding was unauthorized ánd void *311and respondent was not bound to recognize it. Copies of the petition, return to the writ and judgment of the court are" made part of the petition for mandamus. The petition for the writ of habeas corpus was in due form, alleged the petitioner was then sane and was wrongfully restrained of his liberty by Dr. Michell. In his return to the writ Dr. Michell denied relator was in his custody or control or that relator was restrained of his liberty. The return averred relator had never at any time been in his custody otherwise than as a voluntary resident and medical guest at the sanitarium, without formal commitment of any court, and was under no physical restraint. The judgment recites the court heard the proofs of the respective parties and found relator was sane; that he was unlawfully detained by Dr. Michell; that he ought not to be remanded to his custody, and he was ordered forthwith discharged and set at liberty. That judgment has never been set aside or reversed and is in full force and effect.
Respondent has filed, and by reference made it part of his answer, a transcript of the testimony heard on the trial of the habeas corpus proceeding and asks that it be considered in this proceeding for the purpose of showing, as he alleges, that at the time the writ of habeas corpus was issued and the judgment rendered relator was not detained by Dr. Michell but was at large, exercising full liberty to go where he desired and was not confined by or under the control of Dr. Michell. The State authorities having charge of the care and treatment of the insane are given power to license houses or places where such persons may be lawfully detained and to require the keepers of such places to make reports to the State authorities. It is not denied that Dr. Michell complied with the requirements of the law and was authorized to receive and detain in his sanitarium insane persons.
The circuit court of Peoria county in the habeas corpus proceeding had jurisdiction of the subject matter and of the *312parties. The issues made and tried were whether relator was sane and whether he was unlawfully restrained of his liberty by Dr. Michell. Nothing appears from the facé of the record or the judgment to show the court was without jurisdiction to adjudicate these issues. The basis .of respondent’s contention that the Peoria county circuit court had no jurisdiction to render the judgment is that the facts proved at the hearing did not authorize it. We had a very similar question before us for decision in Swager v. Gillham, 278 Ill. 295. We then said: “If the court had jurisdiction of the habeas corpus proceeding and of the parties its judgment is not void, and whether it was right or wrong cannot in this proceeding be inquired into. * * * Whether the judgment was warranted by the testimony or whether it was erroneous, it was a judgment of a court of competent jurisdiction having jurisdiction of both the subject matter and the parties, and cannot be reviewed in this proceeding but must be considered as a valid and binding judgment.” To the same effect is People v. Petit, 266 Ill. 628, where we held whether a judgment was authorized by the facts or the law can only be determined by this court on appeal or writ of error and cannot be determined on a petition for mandamus. There is nothing in this case to take it out of the general rule that a judgment of a court having jurisdiction of the subject matter and the parties is valid and binding until reversed or vacated, and it cannot be attacked for error in another and independent proceeding.
Respondent also contends that relator has another remedy to procure the judgment finding him insane set aside, and the writ of mandamus should not issue for that reason. Section 9 of chapter 87 of Hurd’s Statutes provides: “The proceedings for a writ of mandamus shall not be dismissed nor the writ denied because the petitioner may have another specific legal remedy, where such writ will afford a proper and sufficient remedy; and amendments may be allowed as in other civil suits.”
*313What we have said and the conclusion we have reached render further discussion of respondent’s contentions unnecessary. Under the law it was his duty to rescind and set aside the judgment of insanity.
The writ of mandamus is ordered to issue, the judgment to be entered as of the date of the submission of this cause.
Writ awarded.