delivered the opinion of the court:
At the April term, 1915, this petition was filed by leave of court, praying for a writ of mandamus against the respondent, George Kersten, judge of the circuit court of Cook county and ex-officio judge of the criminal court of Cook county, commanding him forthwith to enter an order in a case pending in the criminal court of Cook county entitled People of the State of Illinois ex rel. Maclay Hoyne vs. Edmund M. Allen, warden of the penitentiary of the State of Illinois, remanding Nathan Steinberg to the custody of the said warden. The petition alleges that at the September term, 1912, of the criminal court of Cook county Nathan Steinberg was convicted of the crime of burglary and was sentenced to the penitentiary at Joliet, where he was confined, pursuant to such sentence, from September 24, 1912, until December 21, 1914; that upon the latter date there was presented to respondent, who was then presiding as one of the judges of the criminal court of Cook county, a petition by the People, on the relation of Maclay Hoyne, State’s attorney, against Edmund M. Allen, warden of the penitentiary, for the writ of Jmbeas corpus ad testificandum, commanding the warden to produce said Stein-berg in the criminal court of Cook county to testify in a certain cause then pending before the grand jury of said court; that the writ was issued añd Steinberg produced accordingly before said criminal court; that respondent, as such presiding judge, on December 22, 1914, entered an order in that cause transferring the custody of said Stein-berg from the warden of the penitentiary to the sheriff of Cook county until the further order of the court; that the life of the grand jury before whom Steinberg was brought up to testify having expired, the Attorney General made application to respondent to remand Steinberg to the custody of the warden of the penitentiary; that the hearing on this application was from time to time delayed until March 31, 1915; that on that date the State’s attorney appeared and presented an affidavit setting up that the presence of Steinberg was necessary in the city of Chicago in order that the State’s attorney might consult with him in reference to the prosecution of the case of The People vs. James O. Storen et al.; that the relator objected to the consideration of the affidavit but the court considered the same, and it was then stipulated by and between the relator and the State’s attorney that the records of the county jail of Cook county showed that Steinberg had not left the jail to testify before the grand jury or before any court between February 26, 1915, and March 31, 1915; that prior to February 26, 1915, Steinberg had been outside-the jail on nineteen different days on various missions, and that the respondent thereupon refused to remand Steinberg to the custody of the warden of the penitentiary.
To the petition the respondent interposed a general and special demurrer and the cause was submitted on the demurrer. The grounds of demurrer which are relied upon here are, that the State’s attorney is a necessary party and should be given an opportunity to plead; that the writ will not issue to correct a void order of court, and that the action sought to be coerced is a judicial and discretionary action of the court, which cannot be compelled by mandamus.
This petition is presented by.the People on the relation of the Attorney General, the chief law officer of the State. It is incumbent upon the Attorney General, and the State’s attorney as well, to protect the interests of the people, and it would indeed be a novel situation which would require the State’s attorney to be made a party defendant in a suit brought by the Attorney General to conserve the rights of the people. Should the writ issue, it would command the action only of the respondent and would require nothing to be done on the part of the State’s attorney.
Petitioner contends that .a judge of the criminal court of Coolc county has no power to issue the writ of habeas corpus ad testificandum to produce a witness to testify before the grand jury, and that before such a writ is issued the judge or court before whom the application is made should first require that notice of the application be given to the Attorney General, as representing the warden of the penitential It is also contended that the writ should not issue except upon a sworn petition and a strict showing of the materiality of the testimony and the necessity of the presence of the prisoner. These are all matters going to the propriety of the issuance of the writ. In this particular case, under this petition, it is not proper to inquire whether the writ was improvidently issued, as that is a matter personal to the warden and is a question which could only be raised by him upon a motion to quash the writ. He has responded to the writ without questioning its sufficiency, and the only matter presented for determination is whether, the prisoner having been taken from the custody of the warden by order of the court, the respondent should be commanded to enter an order restoring the prisoner to the custody of the warden.
.Our statute provides that the several courts having authority to issue writs of habeas corpus may issue the same when necessary to bring before them any prisoner to testify, and that after any such prisoner shall have given his testimony he shall be returned to the jail or other place of confinement whence he was taken for the purpose of testifying. (Hurd’s Stat. 1913, secs. 34, 35, p. 1352.) As the criminal court of Cook county has authority to issue writs of habeas corpus, the respondent clearly had jurisdiction. to issue the writ of habeas'corpus ad testificandum under the statute. Respondent, however, was without power to enter an order taking the prisoner from the custody of the warden and placing him in the custody of the sheriff of Cook county. The issuance of a writ of habeas corpus ad testificandum does not have the effect of taking the prisoner out of the custody of the officer in whose charge he is, and in this case it was the duty of the warden, in producing Steinberg in answer to the writ, to retain custody of him and to return him to the penitentiary immediately upon the conclusion of his testimony. Under the common law an officer thus having the custody of a prisoner was held to a strict accountability in producing such prisoner in response to a writ of habeas corpus ad testificandum and in returning him to the place of confinement. If, in going to and from the place where the testimony was to be taken, the officer traveled an unreasonable, circuitous route, or if he delayed the return of the prisoner to, the place of confinement after the testimony had been completed, he was held liable for an escape. Our statute does not contemplate that any of these restrictions shall be in the least relaxed. While courts have the power to require the production of prisoners as witnesses when the same may be necessary, the duty devolves upon the officer who has such prisoner in custody to see that his removal from the place of confinement to the court where his presence is required, and his return, are accomplished as expeditiously as possible.
Respondent was represented upon the hearing of this petition by the State’s attorney of Cook county, who admitted, upon oral argumeñt, that the order entered by respondent transferring the custody of Steinberg from the warden to the sheriff of Cook county was void and that respondent had no power to enter such an order. He then contended that theoretically the prisoner has been all the time in the custody of the warden, and as the order of- the court transferring the custody of the prisoner was void there is no occasion for an order remanding the prisoner to the custody of the warden. The order entered by the court was unquestionably void. The entry of a void order, however, may be required to be expunged by mandamus, (People v. Petit, 266 Ill. 628,) and a writ commanding respondent to enter the order remanding the prisoner to the custody of the warden would be, in effect, requiring the respondent to expunge the order transferring the custody of the prisoner from the warden to the sheriff. As the records of the criminal court stand, there is an order there transferring the custody of Steinberg to the sheriff, and he is, in fact, actually in the custody of the sheriff.
While the warden may have been at fault in turning over the custody of his prisoner to the sheriff, the void order of the court should not be allowed to remain as an obstacle to prevent him from speedily returning his prisoner to the penitentiary.
The demurrer is overruled and the writ awarded as prayed.
Writ azvarded.