A School Resource Officer at Campbell County Middle School was made aware that the boy had posted photos pictures of weapons, Alexandria Police said. They then alerted officials in Pendleton County of the situation.
Police found pellet guns during their investigation and arrested the boy, they said.
His age has not been released.
"Thank you to those that notified school and law enforcement officials of the possible threat. It takes everyone in the community to be alert and listen to those around you to help protect our students, staff, and community," Pendleton County Superintendent Anthony Strong wrote to parents.
Strong noted that about 20 percent of the school population was absent on Tuesday.
The juvenile was arrested is currently located at the Campbell County Juvenile Detention Center.
PHOTO: Phillip A. Sharp Middle School in Pendleton County.