HARRISBURG, S.D. (AP) — A teenage student was charged with attempted murder Thursday in the shooting of a South Dakota high school principal who was lightly wounded in the arm.

Lincoln County State's Attorney Tom Wollman said Mason Buhl, 16, is charged as an adult on one count each of attempted murder and the commission of a felony while armed with a firearm. Buhl is accused of confronting Harrisburg High School Principal Kevin Lein with a handgun in his office Wednesday morning and firing a single shot.

Buhl pleaded not guilty in a brief court appearance Thursday in Canton, speaking little except to answer questions from the judge. The charges each carry a maximum penalty of 25 years in prison. Wollman said state law requires him to charge a 16-year-old as an adult when the felonies are serious enough.

Judge Bradley Zell appointed an attorney for Buhl and set no bond. A preliminary hearing is scheduled for Oct. 13.

Buhl, a junior, was tackled after the shooting by Assistant Principal Ryan Rollinger, who, along with the school's activities director, held him down until sheriff's deputies arrived. No one else was hurt, and students were sent home. Lein was discharged from the hospital Wednesday afternoon.

"We're completely blessed," the 57-year-old principal said Thursday following a full day back at school. "I don't know what hand of God was in my office yesterday, what hand of God pushed us all to do the right thing."

Lein, sporting a sling on his right arm with a bandage sticking out from his yellow shirt, said the bullet hit his right ulna and humerus bones before deflecting into his rib. The bullet fell out when he took off his shirt, he said.

Buhl's father told The Associated Press on Wednesday that his ex-wife, with whom his son lives, called to tell him that he had been arrested following the shooting at school. He said his son's been quiet over the past year.

"Something's just going on inside of him and he's just mad at everybody, I think," Rodney Buhl said. "I don't know what would've made him do something like this."

He didn't say where his son got the handgun, but said he and his son would regularly target shoot outside and that his son had taken gun safety courses. Wollman would not say where the student got the gun.

Lein offered "deep prayers" to Buhl and his family.

"I hope he is OK and I hope that he can get the help as soon as possible that he might need," the principal said.

The school has about 635 students from Harrisburg and other communities. Harrisburg, a town of about 5,000 residents, sits 10 miles south of Sioux Falls.

Classes resumed Thursday, and Lein and Rollinger returned to the job "not on my accord but on their accord," said superintendent Jim Holbeck.

Lincoln County Sheriff Dennis Johnson praised school administrators and law enforcement officers for preventing further tragedy. Asked what can be done to keep guns out of schools, Johnson said militarizing the hallways with metal detectors with armed guards is not the answer.

"We can't have that. That's not our society," Johnson said. "That's certainly not our state. That's certainly not Harrisburg."

___

Associated Press writer Kevin Burbach in Sioux Falls contributed to this report.