PINE PLAINS, N.Y. — A former student held a school administrator hostage for more than an hour Tuesday morning, then surrendered to police without firing a shot, officials said. No one was injured.

A state government official said the man in custody is Christopher Craft of Pine Plains and the hostage was Stissing Mountain Middle School Principal Bob Hess. The official spoke on condition of anonymity because he was not authorized to release details.

The Stissing Mountain middle and high schools share a campus.

Trooper Tom Jones Jr. said police are going room by room through the combined middle and senior high schools as a precaution, evacuating students as they go.

"Evidently, there is some speculation that he (the gunman) had a loved one in the military and somehow this is some contrived scheme on his part to do something about that," Pine Plains Town Supervisor Gregg Pulver told The Associated Press Radio.

Pulver said the gunman was in his 40s. Police were in contact with the suspect throughout the standoff, he said.

Pulver said counseling will made available to students. The students are being loaded onto buses and taken to a highway garage to be accounted for before being sent back to school, according to Lt. Tom Lasher of the Dutchess County Sheriff's Office.

The school about 90 miles north of New York City was on lockdown just after school began Tuesday with the gunman and his hostage contained to one room. Students and other faculty members were locked in other rooms.

After the man surrendered, armed officers could be seen standing guard at the front door of the school. The handcuffed man was led to an ambulance, where he was checked by paramedics.

The high school has about 500 students, while the middle school has about 300 students.

Parents were told to gather in a parking lot at a restaurant a couple of blocks from school. Hundreds of people, including parents and other townspeople, were milling around an intersection near the school, which sits in a rural valley amid rolling hills.

Lisa Pusello, whose son is a sixth grader at the school, said she heard about the incident by phone from a girlfriend.

"I'm thinking the whole time, 'How can this happen in our little town?'" she said as she waited for her child.

Copyright 2015 Associated Press. All rights reserved. This material may not be published, broadcast, rewritten, or redistributed.