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.
2014: The Year in Music [PHOTOS]