The girl's 18-year-old cousin Catrell Walls was arrested after the teacher raised the alarm with the school's headteacher, Chicago's Fox 32 reported.
US authorities said he faces a felony charge of predatory criminal sexual assault in connection with the incident last Thursday.
Walls appeared in court Saturday and tearfully told prosecutors, “I don’t know why. I’m sorry, I’m sorry" after being denied bail.
His defense attorney said the high school senior reportedly blamed his attention deficit hyperactivity disorder (ADHD) for issues with controlling his impulses.
Judge Charles Beach said: “This ongoing history of assault, for approximately a year, according to the victim, leads me to believe this is not something that will just stop because I have ordered it to.
"This history and his actions from this case lead me to believe that he is a threat to an individual and the community as a whole.”
Police said the child was taken to Comer Children’s Hospital following the alleged sex crime in Walls' grandmother's home.
After the teacher alerted the school’s principal, the principal contacted the girl’s family, Chicago police and the Illinois Department of Children and Family Services.
During a visit to the child to get more information about what happened, the girl reportedly told the school principal that Walls had molested her other times as well, the report said.
Walls’ next court date is November 21, according to FOX 32.