The gun was discharged about 8:15 a.m. in the cafeteria of Westside Elementary, The Memphis Commercial Appeal reported.
No one was injured, said Shelby County Schools spokesman Christian Ross.
Police said the boy apparently fired the gun inadvertently as he removed it from a backpack.
Children at the school were taken home by their parents.
Kate Middleton recycles dress at movie premiere
Gal Gadot cast as Wonder Woman for 'Batman vs. Superman'