A sheriff says a ninth-grade student who was seen on a school bus with a pellet gun two days in a row sparked the lockdown of three Virginia schools.

Culpeper County Sheriff Scott Jenkins told a news conference Wednesday that the 15-year-old had told other students he intended to harm people.

Jenkins said the boy surrendered Wednesday to sheriff's deputies outside of school and the pellet gun was recovered at his residence.

The sheriff said students saw the student with the pellet gun on the bus Tuesday and Wednesday but only told teachers of the weapon on Wednesday, when the schools were put on lockdown.

Jenkins said there is no evidence other students were involved. He said an investigation is underway and charges are pending.