The principal of a South Carolina high school where pipe bombs were discovered and disarmed after a shooting confirmed Wednesday that a second student was being questioned in the incident.

Socastee High School principal Paul Browning said police asked the second student about the Tuesday afternoon event at the school in the northeast part of the state, and the student was released to his parents.

The incident began when a freshman confronted an on-campus officer and fired a gun before being taken into custody, police said. Students were evacuated to a football field and bomb squads removed and disarmed the explosive devices.

The students returned to school Wednesday after walking through metal detectors, which will be used for the rest of the week.

Detectives also interviewed other students Wednesday about the incident and reports that comments had been posted on a social networking site before the shooting, Browning said. He could not confirm that any of the comments came from the freshman.

School resource officer Erik Karney encountered the freshman Tuesday afternoon and the two got into a struggle, Horry County Police spokesman Sgt. Robert Kegler said. During the fight, the student shot at Karney, and while the bullet missed him, the officer was injured after it struck a wall, Kegler said.

Karney subdued the student and took him into custody. Karney was later treated and released from a hospital.

Police said they also found items "consistent with the construction of pipe bombs and other incendiary devices" at the freshman's Myrtle Beach home.

The student has not been identified because of his age. He is expected to appear in Family Court in Conway on Friday, prosecutor Greg Hembree said.

Hembree intends to bring a charge of attempted murder against the teen and wants to prosecute him as an adult, though a judge will have to rule on such a request. The freshman could also face charges for alleged possession or construction of an incendiary device, Hembree said.

Officer Karney was scheduled to return to the school Monday.

Horry County School spokeswoman Teal Britton said she was not aware of any discipline issues involving the freshman, and urged anyone with information about the incident to come forward.

"No metal detectors or any other safety plan is as effective as students who have the courage to come forward and warn adults if they are aware of any potential threat, which in effect could result in being a threat to them and their school," she said.