An Illinois judge has ordered mental evaluations for a freshman high school student charged in the shooting of another student.

The judge on Thursday ordered the student to remain in a state juvenile detention facility. The boy is charged with aggravated battery with a firearm. His parents attended the hearing and agreed to the evaluations.

The shooting in the Mattoon High School cafeteria left one student hospitalized in stable condition. Coles County State’s Attorney Brian Bower told the judge that the boy had a semi-automatic handgun. Bower said a police investigation found that a teacher grabbed the boy’s arm as he fired at a girl. The gunshot missed the girl but hit another student in the upper chest.