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.
Ray Liotta sues skin care company over use of likeness
Boston schools pull out free condoms over wrapping complaints