The sheriff says they detained the 10 and 12-year-olds when a Meadowview Elementary school teacher found the loaded weapon in a book bag Friday.
The children are charged with possession of a firearm on school property and conspiracy to commit capital murder.
The sheriff said the pair threatened to kill as many students, faculty and staff as they could and intended to run away afterward.
Neighbors say they're in shock.
The sheriff's office is trying to determine how the boys got the gun. In the meantime, both of them remain in custody.