The unidentified boy will appear at a hearing in Kane County Tuesday.
The charge involves unlawful use of a weapon.
A teacher at Washington Middle School noticed a group of students milling around the boy’s locker.
The teacher and an administrator searched the locker and found the gun inside.
The gun belonged to a member of the eighth-grader’s family.