Police said explosive devices, including a including a molotov cocktail, were found in the grounds of the school around 40 miles south of Houston.
Harris County Sheriff Ed Gonzalez told reporters the majority of the dead at Santa Fe High School were students, but a teenager had been remanded in custody over the incident.
Santa Fe school police officer John Barnes has been named among the injured.
Officer Barnes is in a critical condition and underwent surgery on Friday afternoon, according to local media.
CBS News sources named the suspect as 17-year-old Dimitrios Pagourtzis, who reportedly told authorities he intended to kill himself but gave up because he did not have the courage to take his own life.
A second person, who has not yet been named, has also been detained by police.
Governor Greg Abbott said the suspect used a shotgun and a .38 revolver that he appeared to have taken from his father, who legally owned the weapons.
A bomb squad was sent to the scene, and several helicopter ambulances flew victims to hospital.
Mr Abbott added the attack was “one of the most heinous attacks that we’ve ever seen in the history of Texas schools.”
Students said the shooter entered an art class and started shooting shortly before 08:00 local time.
Michael Farina, 17, said he was on the other side of campus when the shooting began and thought it was a fire drill. He was holding a door open for special education students in wheelchairs when a principal came bounding down the hall and telling everyone to run. Another teacher yelled out, “It is real!”
Students were led to take cover behind a car shop across the street from the school. Some still did not feel safe and began jumping the fence behind the shop to run even farther away, Farina said.
“I debated doing that myself,” he said.
Another student, Paige Curry, also 17, told reporters “it’s been happening everywhere,” adding she “always felt like that eventually it was going to happen here too.”
President Donald Trump, speaking at a prison reform event at the White House, described the attack as “absolutely horrific”.
He added: “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”.
It is the deadliest such attack on American soil since the shooting at a Florida high school in February that gave rise to a campaign by teenagers for gun control.
In a Tweet shortly after the incident, the ‘March for Our Lives’ movement wrote: “We are deeply saddened by the tragedy in Santa Fe and send our love and support to the families affected as well as the entire community.”
“This is the most fatal shooting since the one at our school and tragedies like this will continue to happen unless action is taken.”