SALT LAKE CITY -- An 11-year-old boy caught with a gun at school told administrators he brought the weapon to defend himself in case of an attack similar to the mass school shooting last week in Connecticut, school officials said Tuesday.

The boy was being held in juvenile detention on suspicion of possessing a dangerous weapon and aggravated assault after other students at the suburban Salt Lake City elementary school told police he threatened them with the handgun.

Teachers and administrators at West Kearns Elementary School confronted the boy in class Monday after students reported the weapon, said Granite School District spokesman Ben Horsley. The boy had an unloaded gun and ammunition in his backpack, Horsley said.

The boy waved the gun at others during a morning recess, school officials said. Other students, however, didn't report the threat until classes were nearly finished for the day. There was no immediate explanation for the delay, authorities said.

Authorities have not released the child's name. The .22-calibre handgun had been left at the boy's home by a relative, Horsley said.

The child made statements to administrators and mentioned the shooting rampage last week in Newtown, Connecticut, that left 20 students dead, authorities said.

The boy told others his parents sent him to school with the gun for protection, which his parents deny, Horsley said.

"The family is rocked by this. They have been very forthcoming," Horsley said.

The boy was expected to be charged in juvenile court Tuesday, Horsley said.

"This kid made a mistake, and he knows it," Horsley said. "He feels bad about it, and his parents are co-operating with the investigation. He will not be coming back to this school."

No one was injured.