A 14-year-old boy held 29 students and a teacher at gunpoint in a West Virginia high school classroom Tuesday afternoon before he released them after negotiations and surrendered, authorities said. No injuries were reported.

The student took a pistol into a second-floor classroom Tuesday afternoon at Philip Barbour High School in the north-central part of the state, State Police Lt. Michael Baylous said in a statement. It was the ninth day of the new school year in Philippi, a town of some 3,000 residents located about 115 miles (185 kilometers) south of Pittsburgh, Pennsylvania.

Barbour County Schools Superintendent Jeffrey Woofter credited the teacher for maintaining control when classes were about to change and praised the Philippi police chief for talking the suspect into giving up.

Woofter said the teacher talked the boy into not allowing the next group of students to enter the classroom.

"The teacher did a miraculous job, calming the student, maintaining order in the class," Woofter said, declining to identify the teacher by name.

Students who opened the door to enter for the next class were asked to leave. Those students went across the hall to alert another teacher, who then alerted school officials. An assistant principal raced to the hallway outside the classroom, then called the office asking that police be alerted, Woofter said.

Kayla Smith, a 17-year-old senior, said initially no one in her classroom in another area of the school took a "code red" warning seriously.

"Then we all held hands and said a prayer," she said.

Local authorities got first reports about 1:30 p.m. Tuesday of someone with a gun in the building. Students who weren't in the classroom with the suspect were sent to a football field before they were accounted for and sent home by bus.

Woofter said Philippi Police Chief Jeff Walters negotiated the release of the students from the classroom and eventually got the suspect to surrender a few hours after it began.

Walters "did an awesome job negotiating with this very troubled young man," Woofter said.

Barbour County Prosecutor Leckta Poling said she plans to pursue unspecified charges against the suspect, who was taken to a hospital for evaluation. Poling said that because the case involves a juvenile, the court process would be closed. Police haven't identified the student.

State Police Capt. Dave Reider said there will be an increased law enforcement presence at the school on Wednesday when classes resume.

__

Associated Press writer Jonathan Mattise reported from Philippi and John Raby from Charleston.