A 17-year-old student dressed in a trenchcoat and armed with a shotgun and a revolver barged inside a classroom at a southeast Texas high school on Friday and opened fire, killing at least 10 people and terrorizing hundreds more, officials said.

Two teachers and eight students were killed in the shooting at Santa Fe High School, officials said. Thirteen people were also injured, the FBI said Saturday.

The murder suspect was identified as Dimitrios Pagourtzis and police were seeking to gain access to his cellphone and computer, Texas Gov. Greg Abbott said.

Dimitrios Pagourtzis Galveston County Sheriff's Office

"Not only did he want to commit the shooting, he wanted to commit suicide," Abbott said. "He gave himself up. He didn't have the courage to commit suicide."

The weapons that Pagourtzis had with him belonged to his father and there is "no information whether he was aware the son had taken the weapons," Abbott added.

As the town gathered for a prayer vigil in Santa Fe Friday evening, schools Superintendent Leigh Wall said that law enforcement would find the answers that the community is seeking, and that those affected will be supported. The Santa Fe Independent School District announced that schools would be closed on Monday and Tuesday.

“This is only the first of many times that we’ll come together to lift our community back up,” she said. “Today is a day to begin mourning those we have lost, and nursing those who are hurt. We are in this together.”

Along Highway 6, which runs through Santa Fe, there were signs that the city was in mourning. A sign outside Hometown Equipment Rentals read "Prayers for Santa Fe."

At the Galveston County Jail, Pagourtzis, wearing a gray prison jumpsuit and shackles, shuffled into a hearing room in the Galveston County Jail with his head bowed for his video arraignment.

"Yes, sir," he mumbled when asked by Galveston County Judge Mark Henry if he understood the charges.

Pagourtzis requested a court-appointed lawyer when asked if he required one. He is being held on charges of capital murder and aggravated assault of a public servant.

Pagourtzis had no criminal record and Abbott said the only disturbing sign was a photo of a T-shirt emblazoned with the words "Born to Kill" that investigators found on his Facebook page.

Another student who was behaving suspiciously and another person who may have more information about Pagourtzis were being questioned as "persons of interest," Abbott said Friday. Henry, the judge, said Saturday that Pagourtzis told police he acted alone.

Dustin Severin, a 17-year-old student, told NBC affiliate KPRC that he saw Pagourtzis in the hallway shortly before the bullets started flying — and that he was wearing his usual outfit.

"He wears a trenchcoat every day, and it's like 90 degrees out here," Severin said.

Pagourtzis, Severin added, was the victim of bullying — and not just by other students.

"He's been picked on by coaches before, for smelling bad and stuff like that," Severin said. "And he doesn't really talk to very many people either. He keeps to himself."

The Santa Fe Independent School District in a statement on Saturday disputed claims that high school coaches engaged in any bully-like behaviors.

"It has been brought to the District’s attention that several sources are falsely reporting claims about SFISD high school coaches and bully-like behaviors toward the student shooter," the district said. "Administration looked into these claims and confirmed that these reports are untrue."

Among those wounded was a school district police officer, officials said. A source close to the investigation said he was a retired Houston police officer who was in critical but stable condition Friday afternoon at a University of Texas Medical Branch hospital in Galveston. On Twitter, Houston Police Chief Art Acevedo identified the officer as John Barnes, 49, and said, "John is hanging in there and the family is very hopeful."

A law enforcement official said four pipe bombs were found inside the school. Several officials said none of them exploded, and it's unclear whether any were fully functional.

Shaken students said they heard a fire alarm go off and then several shots ring out just before 7:30 a.m. local time (8:30 a.m. ET).

"Next thing you know we hear these loud boom, boom, boom sounds coming from the right of us and all the administrators and teachers are saying, 'Run! Run! Run!,' " student Dakota Shrader told NBC News. "There was nothing we could do but run."

A complaint filed against Pagourtzis said he surrendered around 8:02 a.m. local time. Police said he gave a statement admitting that had shot multiple people with the intention of killing them. He had a Remington 870 shotgun and a .38-caliber pistol, the document said.

While the drama was unfolding, a flag-toting man wearing a Make America Great Again cap and a pistol by his side suddenly appeared outside the school. He was immediately stopped by police.

"This idiot is walking down the street with a pistol by his side," one outraged man told KPRC. "I believe in the Second Amendment. But this is a crime scene. ... This is a slap in the face."

In Washington, President Donald Trump weighed in on the massacre.

School shooting in Texas. Early reports not looking good. God bless all! — Donald J. Trump (@realDonaldTrump) May 18, 2018

"This has been going on too long in our country, too many years, too many decades now," Trump said. "We grieve for the terrible loss of life and send our support and love to everyone affected by this absolutely horrific attack."

Speaking at the vigil in Santa Fe, Sen. Ted Cruz, R-Texas, said, "Tonight all of Texas is grieving,” Cruz said at the vigil. “Our entire state, and all across the country, millions are lifting this community up in prayer, are lifting the students up in prayer who went through hell this morning.”

Both Trump and Cruz are staunch supporters of the National Rifle Association and have resisted attempts to tighten gun control.

In Parkland, Florida, one of the students who survived the Feb. 14 massacre at Marjory Stoneman Douglas High School — and who has helped lead the charge against the proliferation of guns — also chimed in.

Get ready for two weeks of media coverage of politicians acting like they give a shit when in reality they just want to boost their approval ratings before midterms. — David Hogg (@davidhogg111) May 18, 2018

There have been 16 school shootings this year, according to a Washington Post database that keeps an ongoing tally of these tragedies. And more than 214,000 students in the U.S. have experienced gun violence at school since the 1999 massacre at Columbine High School, where two students — dressed in trenchcoats — murdered 12 classmates and a teacher before killing themselves.

Santa Fe is a city of 13,000 about 30 miles southeast of Houston and more than 200 miles east of Sutherland Springs, Texas, where a gunman barged into a church last fall and murdered 26 people — almost half of them children — with a Ruger assault-type rifle.

Shrader, the terrified student, said she's not sure if she'll ever be able to walk back into the school.

"This is the place where we're supposed to be safe," she said. "I don't feel safe in this town anymore."