US authorities say an 11-year-old boy caught with a gun at school in Utah told administrators he brought the weapon to defend himself in case of an attack similar to the mass shooting last week at a Connecticut primary school.

School officials say the boy has been arrested on suspicion of possessing a dangerous weapon and aggravated assault after other students told police he pointed the handgun at them on a field at a suburban Salt Lake City elementary school.

Officials say school staff confronted the boy in class after hearing he had a weapon and seized the unloaded gun and ammunition from his backpack.

Authorities have not released the child's name and will not say where he got the gun. No one was injured.