A former student at an upstate New York middle school sneaked inside Tuesday, assembled a shotgun in the bathroom and held the principal hostage before surrendering without firing a single shot, police said.

Dutchess County Sheriff Adrian Anderson said Christopher Craft Sr., 42, got into Stissing Mountain Middle School just after classes began Tuesday morning carrying a hidden disassembled shotgun.

He allegedly put the weapon together in bathroom before holding Principal Bob Hess hostage for more than an hour.

Anderson said Craft, of Pine Plains, N.Y., will be charged with first-degree kidnapping, criminal possession of a weapon and criminal trespassing. No one was injured.

"There were no shots fired, and the students are safe," Dutchess County Sheriff's deputy T.J. Hanlon told Fox News. "My understanding is we were successfully able to negotiate a surrender."

Craft walked into the main office at the middle school and held Hess while students and staff were locked down in other parts of the building, Anderson said.

Craft didn't specifically threaten anyone at the school, according to Anderson. Police would not discuss a possible motive.

Craft had two sons who had attended the school, but school officials said neither was currently enrolled. MyFoxNY.com said Craft has a son in the military and is upset with the government, but authorities didn't confirm that.

"I have no idea why this is taking place," Pine Plains Town Superintendent Gregg Pulver said just moments before the alleged gunman surrendered. Police had been in contact with the suspect throughout the standoff, he said.

More from MyFoxNY.com.

Police say Craft and his hostage were contained to one room in the high school, located about 90 miles north of New York City.

After the gunman surrendered, armed officers could be seen standing guard at the front door of the school. Craft was led to an ambulance, where he was checked by paramedics, authorities said.

The school has about 500 students and 100 staff members.

Seventh-grader Zach Pruner said he was in the counselor's office in the next room when the man walked in and began arguing with administrators. He began cursing and talked about being frustrated and confused, Zach said.

"I could hear him in the next room," he said. "I was frozen with fear."

Zach said he hid under a desk for the next two hours. He jumped out a window after getting the attention of the SWAT team by waving his arm, and he held up a sign that said, "One guy with gun and four people inside," he said.

Zach's mother, Susan Treacy, was asked Tuesday if she had learned something about her son.

"Yeah, he's better at this than he is at schoolwork," she replied.

Police went room to room after Craft surrendered, evacuating about 700 students from the combined middle and high schools as they went.

The students were taken to a bus garage, then returned to school by mid-afternoon. They were allowed to go home at about the time the school day normally ends. Some were met by parents; others walked down the main street away from school.

Hess was the psychologist at the school before becoming principal, said Pulver.

"He has a great way of handling people, thank God," he said.

The standoff began around 7:45 a.m. and was over by about 10 a.m., police told reporters in a news conference.

Roads were shut down in the area, according to MyFoxNY.com. Eyewitnesses said they saw students led out of the school single-file by police, MyFoxNY.com reported.

The Associated Press contributed to this report.