delivered the opinion of the court:
In 1950, plaintiff in error, Thomas Brown, was tried by jury in the criminal court of Cook County and convicted *542of the crime of burglary. He was sentenced to- the penitentiary for a term of not less than four nor more than 20 years. Thereafter he filed a petition for relief under the Post-Conviction Hearing Act in the trial court in which he charged that in the proceedings which resulted in his conviction, his constitutional rights were violated in several respects.
The court appointed counsel to represent him at his post-conviction hearing and, at the request of counsel, the bill of exceptions from the original trial was transcribed without cost to petitioner. After the attorney had examined the bill of exceptions, he stated to the court at the hearing that in spite of the fact that the petition alleged that the petitioner’s constitutional rights were violated in several respects, he had elected to proceed upon only one of these allegations, which was the charge that petitioner was deprived of due process of law in that he was not afforded a sanity hearing at the time of his trial to determine whether he was insane at the time of the trial and at the time of the commission of the crime.
The post-conviction hearing in the trial court proceeded solely upon this issue. Following the hearing, the trial court denied any relief to- petitioner who then applied to this court for a writ of error to review said judgment. In the writ of error which was prepared by petitioner’s appointed counsel, there was only one assignment of error, namely that the trial court erred in holding that petitioner had not been deprived of his constitutional rights when he was denied a sanity hearing. We allowed a writ of error and appointed counsel to- represent petitioner. Briefs were filed and the cause was orally argued and is now before us for decision.
It appears from the evidence at the post-conviction hearing, together with the bill of exceptions at the original trial, that at the time of the trial petitioner was 26 years old. Since he was without funds to employ counsel, the *543court appointed counsel to represent him. Neither petitioner nor his appointed counsel made any motion prior to trial for a sanity hearing, and the cause proceeded to trial before a jury. The State introduced its evidence in chief and rested. Thereafter petitioner took the witness stand in his own defense and denied that he had committed the crime. At the close of the first day of the trial, the taking of evidence was not completed and the cause was adjourned until the following morning. When court convened the next day, petitioner’s counsel stated to the court that his observation of the defendant led him to believe that the defendant was not in his right mind and was unable to cooperate with counsel. At that time the attorney moved that the trial be adjourned so that the defendant could be examined by a psychiatrist. This motion was denied by the court, who stated that the defendant would be provided a sanity examination but not at that time. The defendant was then placed on the witness stand again and the State resumed its cross-examination. Thereafter the State proceeded with its rebuttal evidence and the cause was submitted to the jury who returned a verdict of guilty. Defendant’s counsel made a motion for a new trial which was denied without argument. He then made a motion in arrest of judgment and also moved again that defendant be afforded a psychiatric examination before sentence. The matter was continued for several days for sentencing and at that time petitioner’s counsel again renewed his motion for a psychiatric examination which was again denied, the court stating that he did not believe that the defendant was crazy and that a psychiatric examination would be entirely unnecessary.
At the post-conviction hearing, petitioner’s counsel testified and explained his reasons for desiring such an examination in the midst of the trial. He stated that prior to the trial he had several conversations with petitioner and that petitioner was always able to make coherent answers *544to his questions and that he gave no indication that he was of unsound mind. When he put the defendant on the witness stand, the story that the defendant told was entirely different from the story that he had told his attorney prior to trial. Furthermore, the attorney testified that when he talked to petitioner on the morning of the second day of the trial, petitioner was unable to cooperate with him. The trial judge at the post-conviction hearing held that in view of the fact that petitioner’s request for a sanity hearing was not made until after the trial was underway, the request came too late. In his oral remarks at the time of his denial of the petition, the trial court stated that he was relying upon the case of People v. Hart, 333 Ill. 169.
We are of the opinion that the Hart case does not require such a result in the instant case. In the Hart case, the defendant was tried by jury for the crime of robbery. After hearing the testimony the jury returned a verdict finding the defendant guilty and also finding that since the commission of the crime he had become insane and was insane at the time of the trial. No motion had ever been made by defendant or his counsel for a psychiatric examination and there was never any intimation in the record that defendant was insane. We held that under those circumstances the verdict of the jury finding him insane at the time of the trial was not responsive to any issue submitted to the jury and held that the portion of the verdict which found him insane was void, leaving in effect the finding of the jury as to the guilt of defendant. There is certain language in the Hart case to the effect that the issue of insanity should be presented to the court before the trial is entered upon. However, since in the Hart case the question of insanity was never presented to the court, the question of the time when such question should be raised was not involved and the case is not authority for holding that a motion for a sanity hearing must be made before trial.
*545There can be no question but that the trial of a person at a time when he is insane is a violation of due process of law. (People v. Reeves, 412 Ill. 555; People v. Maynard, 347 Ill. 422.) The question before us is whether the denial of a hearing to determine the sanity of an accused at the time of the trial also violates due process of law. It is true as a general rule that it lies within the discretion of the trial court whether the issue of insanity should be first tried before the defendant is placed on trial. (People v. Maynard, 347 Ill. 422.) However, this discretion is not absolute and where, as in this case, defendant’s counsel stated to the court in all good faith that he thought his client was insane and explained to the court why he believed him insane, the court should have made an inquiry into defendant’s mental condition.
It does not matter that the motion of defendant’s counsel was not formally made and might have been technically insufficient under the statute providing for a sanity hearing. The provisions of the statute do not and were not intended to abrogate the common-law rule that no person should be compelled to stand trial while insane. (People v. Maynard, 347 Ill. 422; People v. Gavrilovich, 265 Ill. 1.) Regardless of compliance with the statute, it was the duty of the court, when a bona fide issue of sanity was raised, to determine that issue.
No such determination was ever made. The only semblance of an inquiry made by the trial judge was at the time of the motion in arrest of judgment when defendant’s counsel renewed his motion for a sanity hearing. The court then asked the defendant: “You are not crazy at this time, are you? Do you hear me?”, to which the defendant replied: “I don’t know.” The judge then stated: “I don’t think he is crazy at all.” This purely arbitrary decision by the trial judge, apparently based at least in part upon the defendant’s statement that he did not know whether he was crazy, and without any evidence or argument, is not *546the type of inquiry contemplated by either the common law or the statute.
A construction of the statute which would, in effect, abrogate the common-law rule and deny a hearing on the sanity of an accused unless strict technical rules of procedure are followed deprives the accused of due process of law. (People v. Kadens, 399 Ill. 394.) “A denial of adequate opportunity to sustain the plea of insanity is a denial of the safeguard of due process in its historical procedural sense which is within the incontrovertible scope of the Due Process Clause of the Fourteenth Amendment.” (See United States v. Baldi, 344 U.S. 561, 571, 97 L. ed. 549, 557-558, dissenting opinion.) By virtue of this constitutional right an accused “is entitled to a hearing on the question whether he was insane at the time of the trial.” (Massey v. Moore, 348 U.S. 105, 99 L. ed 135.) No adequate hearing on this issue was afforded to' the petitioner in the case at bar.
One further point requires brief discussion. Throughout this opinion we have been concerned solely with the question of the sanity of the accused at the time of the trial although it was also assigned as a constitutional question that the court failed to conduct a hearing to determine the sanity of the accused at the time of the crime. The defense of insanity at the time of the crime, like any other defense, must be raised at the time of the trial and submitted to the jury. No special jury is empaneled to try this question, it being submitted to the jury who are hearing the principal case. In the instant case, no evidence was presented to the jury on the defense of insanity, nor did defendant request any instructions on that point. It appears from the testimony of the attorney for the defendant that grounds for doubting the sanity of defendant did not appear until the trial was in progress. The defense of insanity at the time of the crime having not been raised, it was waived.
*547For the reasons assigned herein, we are of the opinion that the trial court erred in holding that petitioner’s constitutional rights had not been violated. The order of the criminal court of Cook County is reversed, and the cause remanded with directions to set aside the conviction and grant a new trial.
Reversed and remanded with directions.