
150 Ill. App.3d 572 (1986)
502 N.E.2d 48
THE PEOPLE OF THE STATE OF ILLINOIS, Plaintiff-Appellee,
v.
DAVID P. SHEAHAN, Defendant-Appellant.
No. 2-85-0317.
Illinois Appellate Court  Second District.
Opinion filed December 12, 1986.
*573 G. Joseph Weller and Michael F. Braun, both of State Appellate Defender's Office, of Elgin, for appellant.
Gerald Grubb, State's Attorney, of Belvidere (William L. Browers and Cynthia N. Schneider, both of State's Attorneys Appellate Prosecutor's Office, of counsel), for the People.
Order reversed.
JUSTICE WOODWARD delivered the opinion of the court:
The defendant, David P. Sheahan, was charged with battery (Ill. Rev. Stat. 1985, ch. 38, par. 12-3(a)-1). At his arraignment, the defendant was found guilty of direct criminal contempt of court but mentally ill. He appeals from that finding.
The trial court's order finding defendant in direct criminal contempt stated that during the arraignment, the defendant gestured with his middle finger at the trial judge, and he stated, "You son of a bitch, I have got more authority than you have. I don't take orders from you; I am Elijah, son of God. I am going to kill you." The order further stated that the defendant's demeanor was threatening and of a violent nature. Furthermore, the trial judge indicated that the defendant had, in a previous court hearing, struck him in the face. The trial judge found the defendant guilty but mentally ill of direct criminal contempt and found *574 that the mental illness was not sufficient to constitute a defense of insanity under the laws of Illinois. The trial court then ordered that the defendant be sentenced to 180 days in the Illinois Department of Corrections (Department). The trial court further requested that the Department transfer the defendant to the Department of Mental Health for any mental treatment needed, and that upon completion of such treatment, the defendant was to be returned to the custody of the Department for the remainder of the sentence.
The Department filed a motion to vacate the order and to issue a corrected mittimus. At the hearing on the motion, the attorney for the Department argued that a summary finding of guilty but mentally ill was improper. The trial court denied the motion. The defendant appeals, contending that: (1) the failure to follow statutorily mandated procedures in finding the defendant guilty but mentally ill resulted in reversible error; (2) the trial court had a duty to hold a hearing on the defendant's sanity because there were facts indicating a question as to the defendant's sanity; and (3) the trial court improperly found the defendant in contempt where it could have used a less restrictive means of restoring order.
 1 A person commits criminal contempt of court by conduct which is calculated to embarrass, hinder, or obstruct the court in its administration of justice or derogate from its authority or dignity, thereby bringing the administration of law into disrepute. (People v. L.A.S. (1986), 111 Ill.2d 539, 543.) The act must be volitional, such that it can be said to require a wilful or knowing state of mind. (People v. Ziporyn (1984), 121 Ill. App.3d 1051, 1057, rev'd on other grounds (1985), 106 Ill.2d 419.) Intent or at least knowledge of the nature of one's act is a necessary element of contempt because contempt requires some form of constructive or actual knowledge of what conduct is forbidden. In re Watts (1978), 66 Ill. App.3d 971, 974.
 2 The requisite intent in a direct contempt can be inferred from the contemptuous conduct itself. (Sunset Travel, Inc. v. Lovecchio (1983), 113 Ill. App.3d 669, 675.) In the case of direct contempt, that is, contempt which is committed in the physical presence of the judge or within an integral part of the court while the court is performing its judicial functions (113 Ill. App.3d 669, 674), it is competent for the judge to proceed upon his personal knowledge of the facts and to punish the offender summarily without entering any rule against him and without hearing any evidence (In re L.A.S. (1985), 132 Ill. App.3d 811, 815, aff'd (1986), 111 Ill.2d 539). No formal charge is filed, and no plea, issue, or trial is required. (132 Ill. App.3d 811, 815, aff'd (1986), 111 Ill.2d 539.) In such a case, summary proceedings do not violate the *575 contemnor's right to procedural due process (People v. Rodriguez (1980), 91 Ill. App.3d 626, 629), as due process rights are not applicable in cases of direct criminal contempt (People v. Collins (1978), 57 Ill. App.3d 934, 936).
In this case, we are presented with a question of whether the trial court properly entered a finding of guilty but mentally ill in a summary contempt proceeding. The defendant argues that the trial court's finding in this case, that defendant was mentally ill but not legally insane, indicates that the trial court imposed a plea of guilty but mentally ill on behalf of the defendant and that under section 115-2(b)(1) of the Code of Criminal Procedure of 1963, the trial court must conduct a hearing as to the defendant's mental health (Ill. Rev. Stat. 1985, ch. 38, par. 115-2(b)(1)). Alternatively, the defendant argues that if the trial judge treated the evidence as raising an insanity defense and then rejected insanity and found the defendant guilty but mentally ill, the defendant should have been instructed that to prevail on an insanity defense, he was to prove by a preponderance of the evidence that he was not guilty by reason of insanity. Additionally, statutory requirements mandate that a presentence report be considered at a sentencing hearing after a defendant has been found guilty but mentally ill. Ill. Rev. Stat. 1985, ch. 38, par. 1005-2-6(a).
In response, the State argues that the power to punish for contempt is inherent in all courts and that to impose statutory procedural requirements for a finding of guilty but mentally ill in a contempt case would be unconstitutional as a legislative infringement on the judiciary's powers. The State contends that, as with a determination of insanity, a finding of guilty but mentally ill need not rely on expert testimony. Therefore, according to the State, the trial judge was entitled to rely on his own observations and facts within his knowledge to determine summarily that the defendant was guilty but mentally ill.
 3 We agree with the State to the extent that the court is vested with the inherent power to enforce its orders and to preserve its dignity by the use of contempt proceedings. Such a power inheres in the judicial branch of government, and the legislature may not restrict its use. (In re Baker (1978), 71 Ill.2d 480, 484.) However, while we conclude that a hearing on the defendant's mental capacity to commit the crime was necessary, we do not so conclude on the basis of the statutory requirements regarding pleas of guilty but mentally ill. That statute is not directly applicable since this was a summary proceeding performed without the benefit of counsel and no pleas or defenses were taken.
 4 We draw our conclusion that a hearing is mandated from a belief *576 that since contempt requires intent, where a question as to the defendant's mental capacity to form that intent is raised by the facts, all of the elements of the crime are no longer within the personal knowledge of the judge such that a contemnor may be punished summarily without due process rights, including a hearing and a right to present a defense.
While a contemnor may be adjudged and punished in a summary manner where all of the elements are within the trial judge's personal knowledge (In re L.A.S. (1986), 111 Ill.2d 539, 543), here there were sufficient facts putting the trial judge on notice that the defendant might be mentally ill, making it incumbent upon the trial judge to afford the defendant an opportunity to fashion a defense based upon this mental illness, which might include a defense of not guilty by reason of insanity.
 5 While mental illness is not an affirmative defense (Ill. Rev. Stat. 1985, ch. 38, par. 6-4), an alternative plea or finding may be accepted upon appropriate evidence being introduced when the affirmative defense of insanity is raised or when a plea of guilty but mentally ill is made (People v. Testa (1984), 125 Ill. App.3d 1039, 1052). A finding of guilty but mentally ill is not proper unless the defendant has so pleaded or unless the affirmative defense of insanity is raised. Here the trial judge could not summarily find the defendant guilty but mentally ill as the defendant had not so pleaded and no defense of insanity had been raised by the defendant. In any event, there was a question as to the defendant's ability to form the requisite intent to be guilty of contempt.
In United States v. Flynt (9th Cir.1985), 756 F.2d 1352, defendant was originally charged with contempt. The trial court denied his request for a 30-day continuance to obtain expert testimony and psychiatric examinations. In response to questions on the contempt charge against him, defendant answered with epithets. He was found guilty of four direct criminal contempts for his conduct at the contempt hearing.
The Ninth Circuit Court of Appeals reversed all five contempt findings. In reversing the four direct criminal contempts, the court of appeals relied on the "substantial issue" test as set forth in Rollerson v. United States (D.C. Cir.1964), 343 F.2d 269, and stated as follows:
"[O]ne of the reasons for permitting the summary adjudication of contempt is that a judge who exercises the summary contempt power has full and immediate knowledge of the facts relevant to an adjudication for contempt. [Citation.] * * * However, when, at the time of the allegedly contumacious conduct, the district court has before it information that raises a substantial issue *577 as to the criminal responsibility of the alleged contemnor, and when facts necessary to a proper resolution of that issue are beyond the personal knowledge of the judge, then * * * summary adjudication is inappropriate. * * *
*   *   *
We are well aware of the possibility that appellant's words and conduct might have been deliberately designed to provoke the district court. We are equally aware that appellant may have been possessed of the requisite mental capacity to commit contempt. Nevertheless, the nature of his words and conduct would raise a substantial question as to mental capacity in the mind of any reasonable observer, a question that could be answered only on the basis of facts beyond the immediate knowledge of a district court." 756 F.2d 1352, 1364-66.
 6 Thus, where the record reveals a substantial issue of the mental capacity to commit contempt, the judge or someone acting on behalf of the defendant is required to initiate a sanity hearing. Compare United States v. Flynt (9th Cir.1985), 756 F.2d 1352; Panico v. United States (1963), 375 U.S. 29, 30, 11 L.Ed.2d 1, 2, 84 S.Ct. 19, 20; United States ex rel. DeStefano v. Woods (7th Cir.1967), 382 F.2d 557, 559, aff'd (1968), 392 U.S. 631, 20 L.Ed.2d 1308, 88 S.Ct. 2093 (where contemptuous conduct did not reveal any aspects of incompetence, no sanity hearing was required).
 7 We have determined that remanding this matter for further proceedings in the trial court would be inappropriate. The original charge of battery for which defendant was originally arrested was dismissed by the State at the request of the complaining witnesses. The defendant was sentenced to serve 180 days in the Illinois Department of Corrections. The record before us indicates that that sentence has been served. The nature of the contempt in this case was the threats of bodily harm to the trial court. Since the original charge against the defendant has been dismissed, the defendant will not be returning before that trial court on this charge. Further, in light of the fact that the sentence imposed by the trial court on the defendant has been served in full, further hearings in this case would serve no useful purpose. Cf. United States v. Flynt (9th Cir.1985), 756 F.2d 1352, 1367.
Accordingly, the finding that defendant is guilty of direct contempt but mentally ill is reversed.
Reversed.
LINDBERG and REINHARD, JJ., concur.
