
33 Ill.2d 453 (1965)
211 N.E.2d 685
THE PEOPLE ex rel. Leonard Keith Rose, Appellant,
v.
ROSS V. RANDOLPH, Warden, Appellee.
No. 39185.
Supreme Court of Illinois.
Opinion filed November 19, 1965.
PATRICK A. BARTON, of Chicago, for appellant.
WILLIAM G. CLARK, Attorney General, of Springfield, for appellee.
Judgment affirmed.
Mr. CHIEF JUSTICE KLINGBIEL delivered the opinion of the court:
This is an appeal from a judgment of the circuit court of Randolph County which quashed a writ of habeas corpus and remanded the relator, Leonard K. Rose, to the custody *454 of the warden of the penitentiary at Menard. The issue presented is whether relator is lawfully confined under a sentence imposed by the circuit court of Franklin County, his theory being that the court had lost jurisdiction to sentence him.
On November 24, 1958, the relator, together with his brother, Edward O. Rose, and men named Irvin and Kaiser, were charged in the circuit court of Franklin County with having burglarized a jewelry store in Benton and stealing $2000 in cash and $8000 in merchandise. Upon arraignment all four men entered pleas of not guilty, but Irvin subsequently changed his plea to one of guilty and applied for probation. The remaining defendants were scheduled to be tried by a jury on January 6, 1959.
When the day of trial arrived, the defendants, their counsel, and the State's Attorney had a conference outside the courtroom as a result of which it was agreed that relator would be released on his own recognizance, and be permitted to go unaccompanied to Chicago to recover some of the loot taken in the burglary. Under the plan each of the defendants was to execute a jury waiver and change his plea to guilty, while the State's Attorney was to recommend a light sentence for Kaiser and request that sentencing of relator and his brother be deferred until relator had returned. According to the relator, he was told he and his brother would receive light sentences if he returned with a substantial part of the stolen merchandise, or its cash equivalent, but that his brother would receive a life sentence if he did not return. During the instant habeas corpus proceeding relator testified that the State's Attorney had been the moving force behind the agreement; the latter, to the contrary, attributed the plan to the relator and his counsel and said that he had succumbed to their repeated urgings because the burglary had left the store owner near bankruptcy and desperate for restitution.
Following the conference the principals repaired to the *455 courtroom where, after "due admonition," the trial court permitted defendants to change their pleas of not guilty and accepted their pleas of guilty. On the prosecutor's recommendation Kaiser was sentenced to the penitentiary for a term of five to ten years and the sentencing of relator and his brother was deferred until January 23, 1959. At the direction of the State's Attorney, the sheriff released defendant on his own recognizance. When relator had not returned by January 23, 1959, both the State's Attorney and the trial judge talked to the relator's counsel by telephone, and at the conclusion of the conversation the judge made a docket entry which stated: "Sentencing of Edward O. Rose and Leonard Keith Rose continued at request of attorney for defendants." On February 4, 1959, the State's Attorney wrote a letter to counsel which suggests that March 3, 1959, had been agreed upon as a new date for restitution to be made.
Relator did not return to Franklin County, nor was restitution ever made. Instead, he was arrested in Chicago on Febuary 13, 1959, and charged with an armed robbery in Cook County. In April, 1961, after a mistrial and after having been confined in the Cook County jail for over two years, relator pleaded guilty to the Cook County charge and was sentenced to a term of three to four years, his transfer to the penitentiary at Joliet having been accomplished on July 1, 1961. During this period it appears that the State's Attorney of Franklin County filed hold or detainer orders both with Cook County authorities and the officials at the Joliet penitentiary. Later in July, 1961, relator was transferred to the prison at Menard and on September 11, 1961, as the result of process initiated by the State's Attorney, he was returned to the circuit court of Franklin County. Based upon his prior plea of guilty, he was sentenced to the penitentiary for a term of ten to twenty years for the burglary, the sentence to run concurrently with the one he was then serving for the armed robbery. Thus it came to pass that *456 approximately two years and nine months intervened between relator's plea of guilty and the imposition of sentence.
In contending that he is not validly confined under the burglary sentence, relator relies upon People ex rel. Boenert v. Barrett, 202 Ill. 287, where it was held that an unexplained delay of over two years between a finding of guilty and sentencing caused the court to lose jurisdiction to impose sentence. Clearly, however, the facts in the instant case cannot be controlled by that decision. The delay here, brought about by the ill-advised attempt to gain restitution, was fully explained. But more important, the delay in sentencing relator was not occasioned by caprice or inaction on the part of the trial court, but by the relator's own conduct when he failed to return to the jurisdiction of the circuit court as he had agreed. By such conduct, as well as by the agreement itself, the relator waived any delay in sentencing and is now estopped to deny the jurisdiction of the court. People v. Penn, 302 Ill. 488, 495-496; People v. Morgan, 55 Ill. App.2d 157; Cf. People ex rel. Ellis v. Babb, 412 Ill. 601; People ex rel. Kelly v. Ragen, 392 Ill. 423; People ex rel. Kerner v. McKinley, 371 Ill. 190.
Relator further argues that he is entitled to discharge from custody because he was denied his constitutional right to counsel of his choice at the time sentence was imposed in Franklin County. The legislature, however, has carefully circumscribed the powers of courts in this State to grant discharges in habeas corpus proceedings, and in section 22 of the Habeas Corpus Act it has specifically prescribed the only causes for which a prisoner held under process of a court may be discharged. (Ill. Rev. Stat. 1963, chap. 65, par. 22.) Accordingly, and within the confines of the legislative enactment, we have consistently held that habeas corpus is not an appropriate remedy to reach alleged errors of a nonjurisdictional nature, which occurred in the course of trial. Or, as sometimes said, habeas corpus may *457 not be used as a means of reviewing a judgment which, although erroneous, is not void, whether the errors claimed are errors of law or of fact. (See: People ex rel. Thompson v. Nierstheimer, 395 Ill. 572; People ex rel. Ross v. Becker, 382 Ill. 404; People ex rel. Morris v. Hazard, 356 Ill. 448; People v. Loftus, 400 Ill. 432.) We hold, therefore, that the issue may not be determined in this habeas corpus proceeding, and that relator is left to his remedies of writ of error or post-conviction hearing.
The judgment of the circuit court of Randolph County, quashing the writ of habeas corpus, is affirmed.
Judgment affirmed.
