At least eight people died in a shooting at a Santa Fe, Texas, high school on Friday and police searching the building said they had taken into custody a student suspected of the attack and found explosives in the school building.

The sound of gunshots tore through the air at Santa Fe High School shortly before 8am CT (1300 GMT) on Friday, witnesses told local media, and live TV images showed lines of students evacuating the building while heavily armed police responded to the scene.

The incident was the latest in a long series of deadly shootings at US schools. Seventeen teens and educators were shot dead at a Parkland, Florida, high school in February, a massacre that stirred the nation's long-running debate over gun ownership.

Harris County Sheriff Ed Gonzalez said that eight to 10 people, both students and adults, died in the incident at the school about 48 km southeast of Houston.

"There is one person, a suspect, in custody and a second possible person of interest that is detained and being questioned," Gonzalez said at a news conference.

Explosive devices had also been found at the school and off campus, Gonzalez tweeted. "Law enforcement is in the process of rendering them safe. School has been evacuated."

The suspect is a 17-year-old male, a law enforcement source who spoke on condition of anonymity because he was not authorised to publicly discuss the investigation, told Reuters.

At least nine people were taken to area hospitals for treatment, hospital officials said. The conditions of those people was not immediately clear. Gonzalez said a police officer was also being treated for injuries.

Sophomore Leila Butler told the local ABC affiliate that fire alarms went off at about 7.45am local time (1245 GMT) and students left their classrooms. She said some students believe they heard shots fired, and that she was sheltering with other students and teachers near campus.

"I know that they have gunshot wounds but that's the extent of the knowledge I have at this point," Marshall told reporters at a news conference. "One adult is in our operating room."

"We're ready for more patients," he said. "We have not heard of any en route at this point."

'We all took off'

A male student, who did not identify himself, described fleeing the scene in an interview with CBS affiliate KHOU.

"Three shots that I heard, so we all took off in the back and I tried to get into the trees, I didn't want to be in sight. I heard four more shots, and then we jumped the fence to somebody's house," the student said.

Another sophomore, Dakota Shrader, told Fox 26 TV her 17-year-old girlfriend told her by phone that she was wounded but was recovering in a hospital. "My friend got injured," said an emotional Shrader. "Her leg, she got shot in the leg."

David Marshall, chief nursing officer at the University of Texas Medical Branch, said that the hospital was treating at least three patients - two adults and one person under 18. He said it was not immediately clear if that child was a student.

US President Donald Trump called the latest school massacre heartbreaking.

"My administration is determined to do everything in our power to protect our students, secure our schools and to keep weapons out of the hands of those who pose a threat to themselves and to others," Trump said at the White House.

Days after the Parkland shooting, Trump said that elected officials should be ready to "fight" the powerful National Rifle Association lobby group. Early this month he embraced that group, telling its annual meeting in Dallas "your Second Amendment rights are under siege."

The Second Amendment of the US Constitution protects the right to bear arms.

No major federal gun controls have been imposed since Parkland, though the administration is pursuing a proposed regulatory ban on "bump stocks," which enable a semi-automatic rifle to fire a steady stream of bullets. The devices were used in an October 2017 mass shooting in Las Vegas that killed 59 people but have not played a role in other major US mass shootings.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.