Pine Plains Town Supervisor Gregg Pulver said the gunman at Stissing Mountain High School was in his 40s. No one was injured, he said.
"I have no idea why this is taking place," Pulver said just moments before the gunman surrendered. Police had been in contact with the suspect throughout the standoff, he said.
The school about 90 miles north of New York City was on lockdown 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 school has about 500 students and 100 staff members.
Margaret Hart, who lives across the street from the school, said police cars were in the neighborhood and helicopters flew overhead.
Parents were told to gather in a parking lot at a restaurant a couple of blocks from school.