A 17-year-old student dressed in a trench coat and armed with a shotgun and pistol opened fire at his high school outside Houston on Friday, killing nine students and a teacher, before surrendering to officers, authorities said.
Santa Fe High School, southeast of Houston, joined a long list of US campuses where students and faculty have been killed in a spray of gunfire.
The Texas shooting stoked the nation's long-running debate over firearms ownership and came about three months after 17 teens and educators were fatally shot in Parkland, Florida.
Students said the gunman, identified by law enforcement as Dimitrios Pagourtzis, opened fire in an art class shortly before 8 a.m. Students and staff fled and a fire alarm triggered a full evacuation.
Classmates described Pagourtzis as a quiet loner who played on the football team. On Friday, they said, he wore the trench coat to school in Santa Fe, about 30 miles southeast of Houston, on a day when temperatures topped 90 degrees Fahrenheit.
Texas Governor Greg Abbott said Pagourtzis obtained firearms from his father, who had likely acquired them legally, and also left behind explosive devices.
"Not only did he want to commit the shooting, but he wanted to commit suicide after the shooting," Abbott told reporters, citing a police review of the suspect's journals. "He didn't have the courage to commit suicide."
Ten people were wounded, Abbott said.
Pagourtzis was charged with capital murder and denied bail at a brief court hearing later on Friday, where he appeared in handcuffs and wearing a green prison jumpsuit. He spoke in a soft voice and said "Yes, sir" when asked if he wanted a court-appointed attorney, along with other questions.
Pagourtzis spared people he liked so he could have his story told, a charging document showed.
Abbott said investigators had seen a T-shirt on the suspect's Facebook page that read "Born to Kill," and authorities were examining his journal. But there were no outward signs he had been planning an attack, he said.
"Here, the red flag warnings were either non-existent or very imperceptible," Abbott said.
Some aspects of Friday's shooting had echoes of the massacre at Columbine High School in 1999. The two teenaged killers in that incident wore trenchcoats, used shotguns and planted improvised explosives, killing 10 before committing suicide themselves.
It was the second mass shooting in Texas in less than a year. A man armed with an assault rifle shot dead 26 people during Sunday prayers at a rural church last November.
Flags in Texas and in many other parts of the United States flew at half-staff on Friday to mourn the victims of the fourth-deadliest mass shooting at a US public school in modern history.
A vigil was held Friday night for the victims, who have not been officially identified. Local reports said those killed included a substitute art teacher and a Pakistani exchange student.
Courtney Marshall, 15, said the gunman came into her art class shooting.
"I wanted to take care of my friends, but I knew I had to get out of there," Marshall said, adding that she saw at least one person hit. "I knew the guy behind me was dead."
Two school officers engaged the shooter, including school district police officer John Barnes, who was in critical condition after a gunshot wound to his elbow that almost caused him to bleed out, hospital officials said.
Two others among the injured were also in critical condition.
Texas Attorney General Ken Paxton told CNN authorities were investigating whether anyone else helped in the attack.
The school, which has some 1,460 students, will be closed on Monday and Tuesday.
US President Donald Trump called the latest school massacre "absolutely horrific."
Days after the Parkland massacre, Trump said elected officials should be ready to "fight" the powerful National Rifle Association lobby group, which argues that any gun control contradicts the constitutional right to bear arms.
But no major federal gun controls have been imposed since Parkland, and early this month Trump embraced the NRA, telling its annual meeting in Dallas, "Your Second Amendment rights are under siege. But they will never, ever be under siege as long as I'm your president."
At the vigil in Texas, many sought solace with friends and classmates.
"This will bring us closer together — hopefully, a positive impact from something negative," said Clayton George, 16, who played football with the suspect.