
723 N.E.2d 1246 (2000)
311 Ill. App.3d 415
243 Ill.Dec. 645
The PEOPLE of the State of Illinois, Plaintiff-Appellee,
v.
David SMART, Defendant-Appellant.
No. 4-99-0161.
Appellate Court of Illinois, Fourth District.
Argued October 13, 1999.
Decided January 26, 2000.
*1247 Daniel D. Yuhas, Deputy Defender (Court-appointed), Judith L. Libby, Assistant Defender, Office of State Appellate Defender, Springfield, for David Smart.
Brett Irving, State's Attorney, Pittsfield, Norbert J. Goetten, Director, Robert J. Biderman, Deputy Director, State's Attorneys Appellate Prosecutor, Springfield, for the People.
Justice GARMAN delivered the opinion of the court:
A jury convicted defendant David Smart of burglary, a Class 2 felony, for stealing a purse from a Subway shop. 720 ILCS 5/19-1 (West 1998). Because defendant had committed multiple prior felonies, the court sentenced him under section 5-5-3(c)(8) of the Unified Code of Corrections (Code) (730 ILCS 5/5-5-3(c)(8) (West 1998)) as a Class X offender to 16 years' imprisonment and 3 years' mandatory supervised release. The sole issue raised by defendant on appeal is whether the trial court was authorized to sentence him to three years' mandatory supervised release applicable to Class X felonies. He argues that the trial court was only authorized to sentence him to two years' mandatory supervised release applicable to Class 2 felonies. We affirm.
Section 5-5-3(c)(8) of the Code provides, in relevant part, as follows:
"When a defendant, over the age of 21 years, is convicted of a Class 1 or Class 2 felony, after having twice been convicted of any Class 2 or greater Class felonies in Illinois, and such charges are separately brought and tried and arise out of different series of acts, such defendant shall be sentenced as a Class X offender." 730 ILCS 5/5-5-3(c)(8) (West 1998).
Section 5-5-3(c)(8) enhances the punishment, but not the grade, of the offense. People v. Thomas, 171 Ill.2d 207, 224, 215 Ill.Dec. 679, 664 N.E.2d 76, 85 (1996). Defendant argues that section 5-5-3(c)(8) authorizes enhancement only of the term of imprisonment, not the term of mandatory supervised release. He contends that the plain language of section 5-8-1(d) of the Code (730 ILCS 5/5-8-1(d) (West 1998)), which sets forth the mandatory supervised release terms applicable to various offenses, defines the applicable term in terms of the classification of the felony, not according to the sentence. Since he was convicted of a Class 2 felony, he should have received only a two-year supervised release term.
The State responds that defendant's interpretation of section 5-8-1(d) of the Code requires it to be read inconsistently with the parallel section 5-8-1(a). The relevant provisions of section 5-8-1 are as follows:
"(a) Except as otherwise provided in the statute defining the offense, a sentence of imprisonment for a felony shall be a determinate sentence set by the court under this [s]ection, according to the following limitations:
* * *
(3) except as otherwise provided in the statute defining the offense, for a Class X felony, the sentence shall be not less than 6 years and not more than 30 years;
* * *
(5) for a Class 2 felony, the sentence shall be not less than 3 years and not more than 7 years[.]

*1248 * * *
(d) Except where a term of natural life is imposed, every sentence shall include as though written therein a term in addition to the term of imprisonment. * * * For those sentenced on or after February 1, 1978, such term shall be identified as a mandatory supervised release term. Subject to earlier termination under [s]ection 3-3-8, the * * * mandatory supervised release term shall be as follows:
(1) for first degree murder or a Class X felony, 3 years;
(2) for a Class 1 felony or a Class 2 felony, 2 years." 730 ILCS 5/5-8-1(a)(3), (a)(5), (d) (West 1998).
The fundamental rule of statutory construction is to give effect to the intent of the legislature. A.P. Properties, Inc. v. Goshinsky, 186 Ill.2d 524, 532, 239 Ill.Dec. 600, 714 N.E.2d 519, 523 (1999). The State argues that the legislature clearly intended that a defendant eligible for enhanced sentencing under section 5-5-3(c)(8) of the Code is to be treated as a Class X offender under both subsections (a) and (d) of section 5-8-1. It would be inconsistent to treat such a defendant as a Class X offender for purposes of the term of his imprisonment and not for the term of his mandatory supervised release.
In People v. Anderson, 272 Ill.App.3d 537, 208 Ill.Dec. 954, 650 N.E.2d 648 (1995), the First District Appellate Court discussed this issue. The first district held that while the issue had never before been adjudicated by an Illinois appellate court,
"[I]t is clear that the gravity of conduct offensive to the public safety and welfare, authorizing Class X sentencing, justifiably requires lengthier watchfulness after prison release than violations of a less serious nature. Defendant, having committed his third felony in a relatively short period of time, has demonstrated the wisdom of extended supervision after release, as prescribed by the legislature." Anderson, 272 Ill.App.3d at 541-42, 208 Ill.Dec. 954, 650 N.E.2d at 651.
We agree with the State and the rationale set forth by the first district in Anderson. Section 5-8-1(d) provides that "every sentence shall include as though written therein a term in addition to the term of imprisonment." 730 ILCS 5/5-8-1(d) (West 1998). This language clearly makes the term of mandatory supervised release part of the entire sentence. Thus, when section 5-5-3(c)(8) states that a recidivist like defendant is to be "sentenced as a Class X offender" (730 ILCS 5/5-5-3(c)(8) (West 1998)), it necessarily means that he must receive an enhanced term of imprisonment and an enhanced term of mandatory supervised release. "In determining legislative intent, courts consider the reason and necessity for the statute, the evils to be remedied, and the objectives to be obtained. Courts avoid construing the statute so as to defeat its purpose or yield an absurd or unjust result." In re K.B.J., 305 Ill.App.3d 917, 921, 238 Ill.Dec. 1007, 713 N.E.2d 253, 256 (1999). It would make little sense for the legislature to provide that Class 2 offenders eligible under section 5-5-3(c)(8) of the Code for an enhanced term of imprisonment are ineligible for an enhanced term of mandatory supervised release. As the first district recognized in Anderson, conduct so offensive that it justifies a longer term of imprisonment surely justifies lengthier supervision after release.
For the foregoing reasons, the judgment of the trial court is affirmed.
Affirmed.
McCULLOUGH and KNECHT, JJ., concur.
