
738 N.E.2d 646 (2000)
316 Ill.App.3d 1230
250 Ill.Dec. 430
The PEOPLE of the State of Illinois, Plaintiff-Appellee,
v.
Kenneth E. BRAZEE, Defendant-Appellant.
No. 2-99-0288.
Appellate Court of Illinois, Second District.
October 24, 2000.
Rehearing Denied November 22, 2000.
*647 G. Joseph Weller and Kathleen J. Hamill, both of State Appellate Defender's Office, Elgin, for appellant.
Paul A. Logli, State's Attorney, of Rockford (Martin P. Moltz, of State's Attorneys Appellate Prosecutor's Office, of counsel), and L. Anita Richardson, Chicago, for the People.
Justice COLWELL delivered the opinion of the court:
Defendant, Kenneth E. Brazee, pleaded guilty to one count of criminal sexual assault (720 ILCS 5/12-13(a)(1) (West 1992)). In exchange for the plea, the State agreed to dismiss a charge of aggravated criminal sexual assault (720 ILCS 5/12-14(b)(1) (West 1992)). No agreement was made as to sentence. The trial court sentenced defendant to 11 years' imprisonment. On *648 appeal, defendant argues that he should have been sentenced as a juvenile rather than as an adult. Alternatively, defendant contends that the sentence imposed by the trial court was excessive. Because we agree with defendant's first contention, we vacate defendant's sentence and remand with directions.

FACTUAL AND PROCEDURAL BACKGROUND
On September 29, 1998, defendant was charged by complaint with two counts of aggravated criminal sexual assault (720 ILCS 5/12-14(b)(1) (West 1992)). Count I of the complaint alleged that between July 4, 1992, and October 31, 1992, defendant committed the offense of aggravated criminal sexual assault "in that the said defendant, who was 17 years of age or older, committed an act of sexual penetration with [D.K.], who was under 13years [sic] of age when the act was committed," in that defendant placed his penis in D.K.'s anus. Count II of the complaint alleged that identical conduct occurred between November 1, 1992, and December 31, 1992.
On October 8, 1998, defendant filed a motion to dismiss the charges against him. Defendant presented his motion to the court the same day. He argued that the complaint, as charged, failed to allege sufficient facts to constitute aggravated criminal sexual assault. According to defendant, the alleged ages of defendant and the victim constituted the only basis for the aggravating circumstance. However, defendant contended that, since he was only 15 at the time the assaults allegedly occurred, the case should have been filed in juvenile court. Attached to defendant's motion was a copy of his birth certificate, which showed a birthdate of July 4, 1977. The court continued the case for a hearing on defendant's motion and for the State to investigate defendant's position.
On October 21, 1998, defendant again presented his motion, reiterating that the action belonged in juvenile court because he was only 15 at the time that he allegedly committed the crimes with which he was charged. The trial court explained that, in order to determine whether it had jurisdiction, it needed to "have an evidentiary hearing of some type." However, the court was not prepared to hold a hearing on that date.
On October 23, 1998, defendant was arraigned on a two-count indictment that was filed on October 21, 1998. Count I alleged:
"[B]etween the 4th day of July, 1992 and the 30th day of November, 1995, * * * KENNETH BRAZEE committed the offense of AGGRAVATED CRIMINAL SEXUAL ASSAULT, in that the said defendant, who was 17 years of age or older, knowingly committed an act of sexual penetration with [D.K.], who was under 13 years of age when the act was committed, in that the said defendant placed his penis in the anus of [D.K.], in violation of 720 ILCS 5/12-14(b)(1)."
Count II alleged:
"[B]etween the 4th day of July, 1992 and the 30th day of November, 1995, * * * KENNETH BRAZEE committed the offense of CRIMINAL SEXUAL ASSAULT in that the said defendant knowingly committed an act of sexual penetration with [D.K.] by use of force, in that said defendant placed his penis in the anus of [D.K.], in violation of 720 ILCS 5/12-13(a)(1)."
On December 11, 1998, defendant pleaded guilty to count II of the indictment. In exchange, the State agreed to dismiss count I of the indictment. After reading count II, the court informed defendant that the sentencing range for criminal sexual assault is 4 to 15 years, unless the extended-term provisions apply, in which case the range is from 15 to 30 years.
The cause proceeded to a sentencing hearing on January 26, 1999. At that hearing, the State introduced the statement defendant gave to police in which he admitted to sexually molesting D.K. and D.K.'s two sisters. In the statement, defendant indicated that he began sexually molesting D.K. when D.K. was five or six years old. Defendant estimated that he *649 ceased molesting D.K. "around the end of 1992 or 1993." Defendant attributed his actions to the fact that he was molested as a child. Also admitted into evidence were victim impact statements prepared by D.K. and D.K.'s two sisters.
In addition, the State called D.K. to testify. D.K., who was 15 years old at the time of the sentencing hearing, testified that he pleaded guilty to criminal sexual assault of a younger child. The juvenile court sentenced him to probation. D.K. stated he learned of this type of behavior from what had happened to him. D.K. thought that defendant started molesting him when he was "around 6 or 7" and that defendant ceased molesting him when D.K. was "around 13." D.K. explained that defendant is his cousin and that the molestations would occur at defendant's house on weekends and other days when school was not in session. D.K. testified that defendant's crime negatively impacted his schoolwork and his social life. After D.K. testified, defendant made the following statement in elocution:
"Your Honor, I know what I did was wrong. I have had my counseling for it, you know. I feel that with the counseling I understand why I did it. I would like you to take that into consideration. Also take into consideration, if you would, that this happened 6 years ago, almost 7 years ago."
Following arguments by the State and defense counsel, the trial court rendered its decision. The court noted that among the factors in mitigation were that "defendant pled guilty and brought swift application of correctional measures to him." The court noted that, in aggravation, defendant committed other offenses, and it cited the need to deter others from committing the same offense. The court determined that, since D.K. was not a "family member" for purposes of the criminal sexual assault statute, a prison sentence was mandatory for the protection of the public. As a result, the court sentenced defendant to 11 years' imprisonment.
On February 5, 1999, defendant filed a motion to reconsider sentence. In support of his motion, defendant argued that his sentence was "excessive in light of the nature and circumstances of the offense and the history and character of the defendant." On March 8, 1999, the trial court denied defendant's motion. The same day, defendant filed a notice of appeal.

ANALYSIS
Defendant first contends that the trial court erred in sentencing him as an adult rather than as a juvenile. Defendant notes that he was born on July 4, 1977. Thus, he reasons that he "did not become an adult for purposes of criminal prosecution until July 4, 1994, a date slightly more than half-way [sic] through the period of time in which [his] criminal conduct occurred, according to the indictment: July 4, 1992 through November 30, 1995."
As a preliminary matter, the State contends that defendant has waived consideration of this issue for failure to raise it in his motion to reconsider sentence. Defendant acknowledges that he did not raise this issue in his motion to reconsider sentence. However, defendant counters that since the court sentenced him as an adult, the court imposed a sentence that it had no authority to impose. It is well established that a void sentence may be attacked at any time. See, e.g., People v. Williams, 179 Ill.2d 331, 333, 228 Ill.Dec. 176, 688 N.E.2d 1153 (1997); People v. Didier, 306 Ill.App.3d 803, 806-07, 239 Ill.Dec. 876, 715 N.E.2d 321 (1999); In re E.C., 297 Ill.App.3d 177, 180, 231 Ill.Dec. 550, 696 N.E.2d 846 (1998). As a result, we find that defendant is not barred from raising his claim that he should have been sentenced as a juvenile.
Before we address the merits of defendant's claim, we find it helpful to review the pertinent sections of the Juvenile Court Act of 1987(Act) (705 ILCS 405/1-1 et seq. (West 1996)). Section 5-3 of the Act defines "delinquent minor" as "any *650 minor who prior to his 17th birthday has violated or attempted to violate * * * any federal or state law or municipal ordinance." 705 ILCS 405/5-3(1) (West 1996)(repealed by Pub. Act 90-590, eff. January 1, 1999) (now codified, as amended, at 705 ILCS 405/5-105(3) (West 1998)). However, this definition does not apply to a minor who at the time of the offense was at least 15 years of age and who is charged with, inter alia, aggravated criminal sexual assault. 705 ILCS 405/5-4(6)(a) (West 1996) (repealed by Pub. Act 90-590, eff. January 1, 1999) (now codified, as amended, at 705 ILCS 405/5-130(1)(a) (West Supp.1999)). A minor who is charged with aggravated criminal sexual assault shall have that charge and all other charges arising out of the same incident prosecuted under the criminal laws of this state. 705 ILCS 405/5-4(6)(a) (West 1996) (repealed by Pub. Act 90-590, eff. January 1, 1999) (now codified, as amended, at 705 ILCS 405/5-130(1)(a) (West Supp.1999)).
The Act further provides that, if after trial or plea the minor is convicted of an offense covered by paragraph (a) of subsection (6) of section 5-4 of the Act, then, in sentencing the minor, the court shall have available any or all dispositions prescribed for that offense under the criminal laws of this state. 705 ILCS 405/5-4(6)(c)(i) (West 1996) (repealed by Pub. Act 90-590, eff. January 1, 1999) (now codified, as amended, at 705 ILCS 405/5-130(1)(c)(i) (West Supp.1999)). If after trial or plea the minor is convicted only of an offense not covered by paragraph (a) of subsection (6) of section 5-4, the conviction shall not invalidate the verdict or prosecution of the minor under the criminal laws. 705 ILCS 405/5-4(6)(c)(ii) (West 1996) (repealed by Pub. Act 90-590, eff. January 1, 1999) (now codified, as amended, at 705 ILCS 405/5-130(1)(c)(ii) (West Supp.1999)). However, unless the State requests a hearing for the purposes of sentencing the minor under the criminal laws, the court must proceed under the sentencing provisions of sections 5-22 (705 ILCS 405/5-22 (West 1996) (repealed by Pub. Act 90-590, eff. January 1, 1999) (now codified, as amended, at 705 ILCS 405/5-705 (West 1998))) and 5-23 (705 ILCS 405/5-23 (West 1996) (repealed by Pub. Act 90-590, eff. January 1, 1999) (now codified, as amended, at 705 ILCS 405/5-710 (West Supp. 1999))) of the Act. 705 ILCS 405/5-4(6)(c)(ii) (West 1996) (repealed by Pub. Act 90-590, eff. January 1, 1999) (now codified, as amended, at 705 ILCS 405/5-130(1)(c)(ii) (West Supp.1999)). The State must request such a hearing by filing a written motion within 10 days following the entry of a finding or the return of a verdict. 705 ILCS 405/5-4(6)(c)(ii) (West 1996) (repealed by Pub. Act 90-590, eff. January 1, 1999) (now codified, as amended, at 705 ILCS 405/5-130(1)(c)(ii) (West Supp.1999)).
The primary consideration of statutory construction is to ascertain and give effect to the intent of the legislature. In re E.C., 297 Ill.App.3d at 179, 231 Ill. Dec.550, 696 N.E.2d 846. The language of the statute is the best evidence of legislative intent. E.C., 297 Ill.App.3d at 179, 231 Ill.Dec. 550, 696 N.E.2d 846. In this case, defendant was charged with both criminal sexual assault and aggravated criminal sexual assault. Further, the indictment alleged that defendant committed the offense of aggravated criminal sexual assault when he was at least 15 years of age. Thus, pursuant to paragraph (a) of subsection (6) of section 5-4 of the Act, he was properly prosecuted under the criminal laws of this state. See 705 ILCS 405/5-4(6)(a) (West 1996). However, defendant pleaded guilty only to the criminal sexual assault charge. The State agreed to dismiss count I of the indictment, which charged him with aggravated criminal sexual assault. Since the charge that served as the predicate for defendant's prosecution under the criminal laws was dismissed and the State did not request a hearing for the purposes of sentencing defendant under the criminal laws (see 705 ILCS 405/5-4(6)(c)(ii) (West 1996) (repealed by Pub. Act 90-590, eff. January 1, 1999) (now *651 codified, as amended, at 705 ILCS 405/5-130(1)(c)(ii) (West Supp.1999))), defendant should have been sentenced as a juvenile.
Our inquiry does not end here, however. This case is complicated by another matter. The State asserts that the indictment alleged a pattern of sexual assault extending past defendant's seventeenth birthday. The State hypothesizes that, since some of the alleged conduct could have taken place after defendant's seventeenth birthday, the trial court properly sentenced defendant as an adult. See 705 ILCS 405/5-4(1) (West 1996) (repealed by Pub. Act 90-590, eff. January 1, 1999) (now codified, as amended, at 705 ILCS 405/5-120 (West 1998)). Defendant counters that count II of the indictment charged him with "an act" (emphasis added) of criminal sexual assault. Thus, he reasons that he pleaded guilty to one act of criminal sexual assault. Defendant also points out that while the indictment charged him with "an act" occurring between July 4, 1992, and November 30, 1995, the statement he gave to police indicates that the sexual conduct between him and D.K. ended in 1990 or 1991. Thus, he was less than 17 years old at the time he committed the crime alleged in count II of the indictment. Accordingly, defendant reasons that he could be sentenced properly only as a juvenile.
Under the facts of this case, we agree that defendant should have been sentenced as a juvenile. The statutory basis for our holding is set out above. Below, we set forth the factual basis for our holding.
The factual basis for a guilty plea generally consists of either an express admission by the accused that he committed the acts alleged in the indictment or a recital of the evidence to the court that supports the allegations in the indictment. People v. Vinson, 287 Ill.App.3d 819, 821, 225 Ill.Dec. 283, 683 N.E.2d 451 (1997) (holding that, in absence of recitation or stipulation of facts, police reports, witness statements, or presentence investigation report, trial court erred in denying the defendant's petition to withdraw guilty plea). Nevertheless, the factual basis will be established as long as there is a basis anywhere in the record up to the final judgment from which the judge could reasonably reach the conclusion that the defendant actually committed the acts with the intent, if any, required to constitute the offense to which he is pleading guilty. Vinson, 287 Ill.App.3d at 821, 225 Ill.Dec.283, 683 N.E.2d 451.
Here, defendant's statement to police indicated that he started sexually molesting D.K. in the late 1980s. He indicated that the behavior continued until he "got caught trying to kiss and fondle [his] neighbors' breasts." According to the presentence investigation report, this latter behavior occurred on July 1, 1991. Defendant's statement to police later indicates that in 1992 or 1993 he attended counseling because of his behavior. He states, "After that, I don't remember doing anything like that again."
Based on this evidence, we find that the factual basis for defendant's guilty plea demonstrates that defendant pleaded guilty to "an act" of sexual penetration that occurred before his seventeenth birthday. Defendant was born on July 4, 1977. Thus, even assuming that the conduct charged occurred during 1993, defendant was no older than 16 years of age when this conduct occurred. Thus, he should have been sentenced as a juvenile. Parenthetically, we note that it would have been better practice for the State to separately charge defendant as a juvenile for acts occurring before defendant's seventeenth birthday and as an adult for acts occurring after defendant's seventeenth birthday. See People v. Wasson, 175 Ill.App.3d 851, 125 Ill.Dec. 369, 530 N.E.2d 527 (1988) (noting that instrument charging defendant under statute that was not yet effective rendered indictment defective; better practice would have been to charge defendant under old statute for conduct occurring during effective period of former statute with additional counts *652 under new statute for conduct occurring after new statute's effective date).
We recognize that, under the Act, a minor's commitment to the Department of Corrections (DOC) automatically terminates at age 21 (see 705 ILCS 405/5-33(2) (West 1996)(repealed by Pub. Act 90-590, eff. January 1, 1999) (now codified, as amended, at 705 ILCS 405/5-750(3) (West 1998))). Thus, under the Act, defendant can no longer be committed to the DOC. However, the State had the opportunity to request a hearing for the purpose of sentencing defendant as an adult. The State failed to follow the applicable procedure by filing a motion within 10 days of the entry of a finding or the return of a verdict. See 705 ILCS 405/5-4(6)(c)(ii) (West 1996) (repealed by Pub. Act 90-590, eff. January 1, 1999) (now codified, as amended, at 705 ILCS 405/5-130(1)(c)(ii) (West Supp.1999)). Accordingly, we find that the most prudent course of conduct is to vacate defendant's sentence and remand the cause to the trial court to enter an order sentencing defendant to time served under the sentencing provisions of the Act. Cf. Commonwealth v. A Juvenile, 407 Mass. 550, 554 N.E.2d 1212 (1990) (holding that juvenile court lacked jurisdiction over charges against minor who was 12 or 13 at the time of the alleged offense but who was arraigned when he was 21 years old).
Based on our disposition of this issue, we need not address defendant's alternative argument.

CONCLUSION
For the aforementioned reasons, we vacate the judgment of the circuit court of Winnebago County that sentenced defendant to 11 years' imprisonment. We remand the cause with directions that the circuit court enter an order sentencing defendant under the Act to time served.
Vacated and remanded with directions.
HUTCHINSON and RAPP, JJ., concur.
