The gun was found by a teacher Monday afternoon at Washington Middle School in Aurora.
According to investigators, the boy brought a family member's gun to school to show his friends.
He is being held Monday night at the Kane County Juvenile Justice Center.