A former Blacksburg Middle School student was ordered Monday to spend six months in juvenile detention for trying to sell stolen guns at the school.

Montgomery County Juvenile and Domestic Relations Judge Marc Long convicted the 14-year-old boy of 11 counts of intent to sell stolen property and two counts of possession of a firearm on school property.

The boy admitted in court that he and his cousin broke into a gun store in Buckingham County, where the cousin lives, and stole 24 firearms. The 14-year-old said he took 11 guns to his home in Montgomery County.

He testified that he took at least one gun to school on April 12 and April 16 — the day a student gunman killed 32 people on the nearby Virginia Tech campus as well as himself — and tried to sell them for $150 apiece to get money for tuition to a military school.

The boy said he had bullets for the guns but never loaded any of them. No one was threatened with the weapons.

The boy and his cousin face breaking and entering charges in Buckingham County, where the 14-year-old said they also stole beer, cigarettes and other items from a convenience store and liquor from a state liquor store.