delivered the opinion of the court:
The question common to these consolidated appeals involves the construction of the statute governing the determination of the maximum commitment period for a defendant who has been found not guilty of a criminal offense by reason of insanity. In each of the cases before us, the trial judge relied on a provision of the extended-term sentencing statute in calculating the defendant’s maximum period of commitment. The appellate court reversed in both cases, interpreting this court’s recent decision in People v. Palmer (1992), 148 Ill. 2d 70, as forbidding application of the extended-term statute to insanity acquittees. (Pastewski, 251 Ill. App. 3d 358; Warfield, No. 3 — 93—0042 (unpublished order under Supreme Court Rule 23).) We allowed the State’s petitions for leave to appeal (145 Ill. 2d R. 315(a)), and we now reverse the judgments of the appellate court and affirm the judgments of the circuit court.
The defendant in cause No. 76447, Stanley Pastewski, was charged on October 2,1990, in the circuit court of Will County with burglary and attempted arson. Pastewski was found unfit to stand trial, and he remained unfit for the remainder of the trial court proceedings. At a discharge hearing conducted on March 26, 1992, Pastewski was found not guilty of the two offenses by reason of insanity. Pastewski was then remanded to the Department of Mental Health and Developmental Disabilities for an evaluation on an inpatient basis, in accordance with section 5 — 2—4(a) of the Unified Code of Corrections (Ill. Rev. Stat. 1991, ch. 38, par. 1005 — 2—4(a)).
At a subsequent hearing on the question, defense counsel stipulated to a report by the Department that found that the defendant was subject to involuntary admission; the defendant had no objection to the finding. The judge concluded that the defendant was subject to involuntary admission. In determining the maximum period of confinement for the defendant pursuant to section 5 — 2—4(b) of the Unified Code of Corrections, the judge noted that the defendant’s prior conviction for burglary within 10 years of the present charges would have made him eligible for an extended-term sentence if he had been convicted of the offenses charged here. (See Ill. Rev. Stat. 1991, ch. 38, par. 1005 — 5—3.2(b)(1).) The defendant objected, arguing that this court’s decision in Palmer prohibited the use of the extended-term provisions. The judge disagreed, believing that Palmer was distinguishable, and set the defendant’s maximum period of confinement at 14 years, an extended term. (See Ill. Rev. Stat. 1991, ch. 38, par. 1005 — 8—2(a)(4).) The judge later determined that the defendant could be confined under the commitment order no later than August 31, 1997, after allowing the defendant day-for-day good-time credit and credit for time already served.
The defendant appealed, contending that the maximum period of his commitment could not exceed a regular, nonextended sentence. The appellate court agreed with the defendant that Palmer bars the use of the extended-term provisions in determining an insanity acquittee’s maximum commitment period. (251 Ill. App. 3d 358.) The appellate court therefore reversed the commitment order and remanded the cause so that a new order could be entered without reference to the extended-term statute. We allowed the State’s petition for leave to appeal (145 Ill. 2d R. 315(a)).
The defendant in cause No. 76518, Moses Warfield, was charged with burglary and theft in April 1992 in the circuit court of Will County. A month later, the defendant was charged with burglary in a separate Will County prosecution; the two cases were subsequently consolidated before the same judge who heard Pastewski’s case. On September 28, 1992, the judge determined that the defendant was fit to stand trial and, in a stipulated bench trial, found the defendant not guilty of the charged offenses by reason of insanity. The defendant was then remanded to the Department of Mental Health and Developmental Disabilities for an evaluation on an inpatient basis. The Department concluded that the defendant was subject to involuntary admission. At a hearing on January 7, 1993, the parties stipulated to the contents of the Department’s report, and the court found that the defendant was subject to involuntary admission and committed him accordingly.
In determining the maximum length of the defendant’s commitment at the January 7, 1993, hearing, the judge again relied on the extended-term sentencing provisions, rejecting the defendant’s contention that, under Palmer, the maximum commitment period could not be determined by reference to that statute. In addition, the judge denied the defendant’s separate contention that application of the extended-term provisions to insanity acquittees but not to other classes of defendants violated equal protection. The defendant’s prior conviction for burglary would have made the defendant eligible for an extended-term sentence of 14 years if he had been convicted of the charges here, and the judge thus fixed the defendant’s maximum period of confinement at 14 years. (See Ill. Rev. Stat. 1991, ch. 38, par. 1005 — 8— 2(a)(4).) After allowing the defendant day-for-day good-time credit in addition to credit for time already served, the judge determined that the commitment order could expire no later than January 11, 1998.
The appellate court reversed the judgment in an unpublished order, reaffirming its earlier decision in defendant Pastewski’s appeal that a court may not consider the extended-term statute in determining the maximum period of commitment for an insanity acquit-tee. (No. 3 — 93—0042 (unpublished order under Supreme Court Rule 23).) The appellate court thus remanded the cause for entry of a new commitment order. We allowed the State’s petition for leave to appeal (145 Ill. 2d R. 315(a)) and consolidated the two cases for purposes of argument and disposition.
I
A defendant who is found not guilty of an offense by reason of insanity, whether at a discharge hearing, as in defendant Pastewski’s case, or at a trial, as in defendant Warfield’s case, must be evaluated by the Department of Mental Health and Developmental Disabilities for an assessment of the acquittee’s future treatment needs. (Ill. Rev. Stat. 1991, ch. 38, par. 1005 — 2—4(a); Palmer, 148 Ill. 2d at 83.) If an insanity acquittee is found to be subject to involuntary admission or in need of mental health services on an inpatient basis, he is to be committed to the Department of Mental Health and Developmental Disabilities for an indefinite period of time. (Ill. Rev. Stat. 1991, ch. 38, par. 1005 — 2—4(b).) Section 5 — 2—4(b) of the Unified Code of Corrections further provides:
"Such period of commitment shall not exceed the maximum length of time that the defendant would have been required to serve, less credit for good behavior, before becoming eligible for release had he been convicted of and received the maximum sentence for the most serious crime for which he has been acquitted by reason of insanity. The Court shall determine the maximum period of commitment by an appropriate order.” Ill. Rev. Stat. 1991, ch. 38, par. 1005 — 2—4(b).
In both of the cases before us, the trial court determined that the defendants’ prior criminal records would have qualified them for extended-term sentences under section 5 — 5—3.2(b)(1) of the Unified Code of Corrections if the defendants had been found guilty of the present charges. (Ill. Rev. Stat. 1991, ch. 38, par. 1005— 5 — 3.2(b)(1).) Accordingly, the judge relied on that portion of the extended-term statute in determining the maximum periods of confinement for both defendants. The appellate court reached the opposite conclusion, however, believing that the period of commitment for an insanity acquittee may not be based on the extended-term provisions. As we have noted, the appellate court believed that the present appeals were controlled by Palmer, a decision that the trial judge found distinguishable. We now consider that case, and its correct interpretation.
Palmer involved the application to an insanity acquittee of the extended-term sentencing provision found in section 5 — 5—3.2(b)(2) of the Unified Code of Corrections. That portion of the statute permits the imposition of an extended-term sentence when "a defendant is convicted of any felony and the court finds that the offense was accompanied by exceptionally brutal or heinous behavior indicative of wanton cruelty.” (Ill. Rev. Stat. 1991, ch. 38, par. 1005 — 5—3.2(b)(2).) Palmer construed the wanton cruelty provision as requiring proof that the defendant consciously sought to inflict pain and suffering on the victim of the offense. (Palmer, 148 Ill. 2d at 87-88.) The court believed that a finding of that intent could not be made with respect to an insanity acquittee, who is, by definition, not criminally responsible for his conduct. (Palmer, 148 Ill. 2d at 88.) The court concluded, "The successful assertion of the insanity defense precludes a finding that the insanity acquittee was conscious of his conduct such that the requisite finding that the insanity acquittee’s offense was indicative of wanton cruelty could be made.” (Palmer, 148 Ill. 2d at 88.) In the course of its discussion, the Palmer court broadly declared that "a trial court may not base a maximum commitment period for an insanity acquittee on the extended-term statute” and, later, that ”[t]he maximum period of commitment for an insanity acquittee may not be based upon the extended-term statute.” (Palmer, 148 Ill. 2d at 84, 94.) The appellate court believed that the results reached in the present cases were dictated by the broad statements appearing in Palmer.
The scope of the Palmer decision must be limited to the precise question before the court in that case. Section 5 — 5—3.2(b) of the Unified Code of Corrections authorizes the imposition of an extended-term sentence in a variety of circumstances, and the Palmer court addressed only one of the multiple grounds then listed in the statute. (See Ill. Rev. Stat. 1987, ch. 38, pars. 1005— 5 — 3.2(b)(1) through (b)(5); see also Ill. Rev. Stat. 1991, ch. 38, pars. 1005 — 5—3.2(b)(1) through (b)(7).) Palmer decided nothing more than that the wanton cruelty provision of the extended-term statute is not an available means of determining the maximum period of commitment for an insanity acquittee. Thus, we believe that the Palmer court spoke too broadly when it suggested, in dicta, that the maximum commitment period for an insanity acquittee may never be determined with reference to the extended-term statute. Palmer addressed only the wanton cruelty provision of the extended-term statute, and the case said nothing, and decided nothing, regarding the application of the other portions of that statute to insanity acquittees. We therefore do not construe Palmer as establishing that the extended-term sentencing provisions may never be used in determining the maximum period of commitment for an insanity acquittee.
The defendants argue, however, that application of the extended-term provision involved in these appeals is inconsistent with the nature of an insanity acquittal. The defendants maintain that the portion of the extended-term statute at issue here, section 5 — 5— 3.2(b)(1), is purely punitive and, thus, may not be used in determining the maximum commitment period for an individual who has been found not guilty of an offense by reason of insanity. According to the defendants, an acquittal on grounds of insanity means that the offender lacked the requisite mental state that could ever justify use of the repeat-offender provision to determine the maximum time of commitment.
Section 5 — 5—3.2(b)(1) allows the imposition of an extended-term sentence on a felon who, within a specified period of time, has previously been convicted of committing a felony of the same or greater class. The purpose of a recidivist statute such as section 5 — 5— 3.2(b)(1) "is to impose harsher sentences on offenders whose repeated convictions have shown their resistance to correction.” (People v. Robinson (1982), 89 Ill. 2d 469, 476.) The defendants maintain that the theories of punishment and deterrence embodied in that provision are entirely lost on one who is acquitted of an offense on grounds of insanity, and who is thus not criminally responsible for his conduct. In light of the statute’s rationale, the defendants believe that this provision, like the wanton cruelty measure at issue in Palmer, may not be used in determining the maximum commitment period for an insanity acquittee.
We do not agree with the defendants that use of this portion of the extended-term statute in determining an insanity acquittee’s maximum period of commitment impermissibly alters the nature of his confinement, or introduces into the commitment an invalid punitive purpose. The extended-term statute is not being applied for deterrent or punitive purposes. A person committed pursuant to section 5 — 2—4(b) need not remain confined for the entire length of the maximum period determined by the judge; instead, he is entitled to earlier release in a variety of circumstances (Ill. Rev. Stat. 1991, ch. 38, pars. 1005 — 2—4(d), (e)). The extended-term provisions thus merely set the maximum period that the acquittee can be confined pursuant to the court’s commitment order, assuming that the initial grounds for commitment continue without change. In these circumstances, the extended-term statute simply provides the rod by which the maximum commitment period is measured.
"[T]he purpose of commitment following an insanity acquittal is to treat the individual’s mental illness, and at the same time protect him and society from his potential dangerousness.” (People v. Williams (1986), 140 Ill. App. 3d 216, 228.) As the appellate court has concluded, using the extended-term statute in these circumstances “does not change the rehabilitative focus of criminal commitment. It also does not alter the indefinite character of the commitment period, since defendant may be released anytime he regains his sanity. The trial court’s actions [in using the extended-term statute] simply provided for a potentially longer period in which defendant could receive treatment subject to judicial review.” People v. Larson (1985), 132 Ill. App. 3d 594, 598.
We thus find no conflict between the successful assertion of an insanity defense and use of the recidivism provision of the extended-term statute in determining the maximum commitment period. We do not believe that use of the extended-term statute in determining the maximum period of commitment for an insanity acquittee constitutes an improper punishment or is inconsistent with the purposes of the commitment order.
For these reasons, we must reject the defendants’ broader suggestion that the punitive nature of extended-term sentencing in general means that no portion of the extended-term statute may ever be used in determining the maximum commitment period for an insanity acquittee. The defendants fail to acknowledge that basing the maximum commitment period on a nonextendedterm sentence, as they prefer, would be susceptible to the same objection they make here. If the punitive character of the extended-term statute precludes its use in determining the maximum commitment period for an insanity acquittee, then one must also question whether the regular, nonextended sentencing statutes may be used for that purpose: as applied to sane defendants, all sentences of imprisonment, whether measured by an extended term or not, have as their goals punishment and deterrence. The defendants do not argue, however, that the statutorily determined maximum period of commitment for an insanity acquit-tee may not be set by reference to the regular sentencing provisions.
In sum, the concerns that prompted the court’s decision in Palmer are wholly absent here. The extended-term provision involved in the present case depends entirely on objective, historical criteria — the defendant’s record of criminal convictions — and makes no reference to the defendant’s mental state or intent, or any other subjective matter that might be considered to conflict with an insanity finding. There exist here none of the inconsistencies between an insanity acquittal and the operative portion of the extended-term statute that troubled the Palmer court.
Defendant Pastewski, who was found not guilty by reason of insanity at a discharge hearing, makes the further argument that he is in a worse position than he would be if he had not been acquitted at the hearing. This is so, the defendant maintains, because an unfit offender who is not acquitted at a discharge hearing may not be confined beyond the length of a nonextended sentence authorized by section 5 — 8—1 of the Unified Code of Corrections. Regarding the period of commitment that may be ordered for an unfit defendant who is not acquitted at a discharge hearing, section 104— 25(g)(4) of the Code of Criminal Procedure of 1963 provides, "For purposes of this Section, the maximum sentence shall be determined by Section 5 — 8—1 of the ’Unified Code of Corrections’, excluding any sentence of natural life.” (Ill. Rev. Stat. 1991, ch. 38, par. 104— 25(g)(4).) The preceding provision thus precludes the court from using the extended-term sentences found in section 5 — 8—2. Defendant Pastewski contends that the statutory scheme operates unconstitutionally in distinguishing between unfit offenders who are acquitted by reason of insanity and unfit offenders who are not.
The defendant’s argument misconceives the fundamental differences between the two classes of offenders. (Larson, 132 Ill. App. 3d at 598-600.) A discharge hearing is an "innocence only” hearing and results in a final adjudication of the charges only if the evidence fails to establish the defendant’s guilt beyond a reasonable doubt or the defendant is found not guilty by reason of insanity. (Ill. Rev. Stat. 1991, ch. 38, par. 104 — 25; In re Nau (1992), 153 Ill. 2d 406, 410; People v. Rink (1983), 97 Ill. 2d 533, 538.) If a judgment of acquittal is not entered, then the defendant may be held for treatment and may face prosecution once he becomes fit for trial.
In Pastewski’s case, the discharge hearing resulted in a definitive resolution of the charges against him, for he was acquitted on grounds of insanity. "A verdict of not guilty by reason of insanity establishes two facts: (i) the defendant committed an act that constitutes a criminal offense, and (ii) he committed the act because of mental illness.” (Jones v. United States (1983), 463 U.S. 354, 363, 77 L. Ed. 2d 694, 705, 103 S. Ct. 3043, 3049.) .The finding of insanity entered at the discharge hearing thus provides the basis for Pastewski’s commitment. "[A] finding of not guilty by reason of insanity is a sufficient foundation for commitment of an insanity acquit-tee for the purposes of treatment and the protection of society.” Jones, 463 U.S. at 366, 77 L. Ed. 2d at 706, 103 S. Ct. at 3050.
In contrast, a defendant who is not acquitted at a discharge hearing has not gained a definitive resolution of the charges against him. As we have noted, a discharge hearing is an "innocence only” hearing, and the failure to enter a judgment of acquittal at that time does not result in a conviction on the underlying charges. The defendant may be tried once he becomes fit; he cannot, however, be held indefinitely. Jackson v. Indiana (1972), 406 U.S. 715, 32 L. Ed. 2d 435, 92 S. Ct. 1845; People ex rel. Myers v. Briggs (1970), 46 Ill. 2d 281.
Different constitutional requirements and consequences thus attend these different outcomes. Given the manifest differences between the two classes of defendants, we find no denial of equal protection or due process in the different dispositions that are made of those defendants. We believe that the differences between the statutory schemes are reasonably related to the different purposes they are designed to serve. (See Foucha v. Louisiana (1992), 504 U.S. 71, 79, 118 L. Ed. 2d 437, 447, 112 S. Ct. 1780, 1785 ("Due process requires that the nature of commitment bear some reasonable relation to the purpose for which the individual is committed”).) The discharge hearing conducted in defendant Pastewski’s case produced the finding that Pastewski was not guilty by reason of insanity. Thus, a final adjudication of the charges against him has been made, and he may now be treated in the same manner as any other defendant who is acquitted on grounds of insanity.
II
In the alternative, the defendants contend that if the extended-term provisions may be used in determining the maximum period of confinement for an insanity acquittee, a judge making use of that statute has discretion in determining what the actual maximum period of commitment should be, and thus may specify a period falling within the extended range allowed for the class of the defendant’s greatest offense. (See People v. Thomas (1988), 168 Ill. App. 3d 113 (insanity acquittee committed for maximum period falling within sentencing range authorized by extended-term statute).) We do not agree.
Section 5 — 2—4(b) of the Unified Code of Corrections provides that the period of commitment for an insanity acquittee is to be for an “indefinite period of time” yet may not exceed “the maximum length of time that the defendant would have been required to serve *** had he been convicted of and received the maximum sentence for the most serious crime for which he has been acquitted by reason of insanity.” The trial judge “shall determine the maximum period of commitment by an appropriate order.” (Ill. Rev. Stat. 1991, ch. 38, par. 1005 — 2—4(b).) We believe that the statute contemplates the performance of what is essentially a ministerial task. Notably missing from the statute is any reference to a hearing at which the court could decide to impose a period of commitment shorter than the length of the maximum sentence fixed by the statute. As we have noted, section 5 — 2—4(b) contemplates the setting of a maximum period of commitment, though an insanity acquittee may become entitled to release prior to that time. Given the rationale for the statute, it would be odd to place in the trial judge discretion to select, as a maximum period of commitment, a time other than the longest span provided by statute. The judge has discretion, as far as the extended-term statute allows, in determining whether criteria authorizing the use of the statute have been met; having determined that application of the extended-term statute is proper, however, the judge does not have discretion to determine what the maximum period of confinement should be.
We thus conclude that section 5 — 2—4(b) requires the trial judge to determine the maximum length of time that the defendant could have been confined upon a criminal conviction, and to use that period as the maximum length of the defendant’s commitment. See People v. Leppert (1982), 105 Ill. App. 3d 514, 519-20 ("The statute provides a clear formula for commitment: the time shall be indefinite, and the maximum is set by operation of law. *** The court may not state a maximum length of commitment different than that provided by statute”).
For the reasons stated, the judgments of the appellate court are reversed, and the judgments of the circuit court of Will County are affirmed.
No. 76447 — Appellate court reversed; circuit court affirmed.
No. 76518 — Appellate court reversed; circuit court affirmed.