The 11-year-old youngster told Granite School District officials he stashed the .22-caliber pistol in his backpack to protect himself from an attack similar to the shooting spree in New England last week that killed 20 school children.
"He has alluded in his defense that he brought it as a way to defend himself and his friends if there was a Connecticut-style incident at the school," district spokesman Ben Horsley told the Salt Lake Tribune.
Horsley said it was not clear whether or not the gun was loaded, although the boy had ammunition in his possession.
The student could face charges of possessing a weapon on school property and could face additional hot water if it turns out he brandished the gun in front of others as some students claimed.
NBC reportedly holds celebs hostage to Jimmy Fallon's show
Aaron Carter is still in love with Hilary Duff