SANTA FE, Texas -- The suspect in the Texas school shooting began his attack by firing a shotgun blast through an art classroom door, sending panicked students to the entryway to block him from getting inside, witnesses said.

Dmitrios Pagourtzis fired again through the wooden part of the door and fatally hit a student in the chest. He then lingered for nearly 30 minutes in a warren of four rooms, killing seven more students and two teachers before exchanging gunfire with police and surrendering, officials said.

Freshman Abel San Miguel saw his friend Chris Stone killed at the door. San Miguel got grazed in the stomach by another volley of shots. He and others survived by playing dead.

"We were on the ground, all piled up in random positions," he said.

Galveston County Judge Mark Henry, the county's chief administrator, said he did not think the attack was 30 minutes of constant shooting, and that assessment was consistent with other officials who said law enforcement contained the shooter quickly. But authorities did not release a detailed timeline to explain precisely how events unfolded.

Junior Breanna Quintanilla was in art class when she heard the shots and someone say, "If you all move, I'm going to shoot you all."

The 17-year-old Pagourtzis walked in, pointed at one person and declared, "I'm going to kill you." Then he fired.

"He then said that if the rest of us moved, he was going to shoot us," Quintanilla said.

When Quintanilla tried to run out a back door, she realized Pagourtzis was aiming at her. He fired in her direction.

"He missed me," she said. "But it went ahead and ricocheted and hit me in my right leg." She was treated at a hospital and spoke with a brown bandage wrapped around her wound.

"It was a very scary thing," Quintanilla said. "I was worried that I wasn't going to be able to make it back to my family."

In their first statement since Friday's massacre, Pagourtzis' family said the bloodshed "seems incompatible with the boy we love."

"We are as shocked and confused as anyone else by these events," said the statement, which offered prayers and condolences to the victims.

Relatives said they remained "mostly in the dark about the specifics" of the attack and shared "the public's hunger for answers."

Zach Wofford, a senior, said he was in his agricultural shop class when he heard gunfire from the art classroom across the hall. He said substitute teacher Chris West went into the hall to investigate and pulled a fire alarm.

"He saved many people today," Wofford said of West.

The mother of one slain student said her daughter may have been targeted because she rejected advances from Pagourtzi, who was an ex-boyfriend of her daughter's best friend.

Sadie Rodriguez said her 16-year-old daughter, Shana Fisher, repeatedly told him no, and he "continued to get more aggressive." The week before the shooting, Fisher "stood up to him" by embarrassing him in class, Rodriguez said.

The Houston branch of the FBI tweeted Saturday that 13 people were wounded in the attack, up from 10 previously. Hospitals reported treating 14 people with shooting-related injuries Friday, and the reason for the discrepancy still was not clear.

In addition to a shotgun and a handgun, Pagourtzis also had several kinds of homemade explosive devices, but they were not capable of detonating, Henry said.

Investigators found a group of carbon dioxide canisters taped together, and a pressure cooker with an alarm clock and nails inside. But the canisters had no detonation device, and the pressure cooker had no explosive material, Henry said.

"They were intended to look like IEDs, but they were totally non-functional," Henry said, referring to the improvised explosive devices common in the early years of the U.S.-led war in Iraq.

Authorities have offered no motive, but they said in a probable-cause affidavit that the suspect had admitted to carrying out the shooting.

The gunman told police that when he opened fire, he avoided shooting students he liked "so he could have his story told," the affidavit said.

From first word of the shooting, at 7:32 a.m. Friday, until confirmation that the suspect was in custody, the attack lasted about half an hour.

Dispatch records indicate that law enforcement first entered the building about seven minutes later after learning of the assault. The suspect was said to be in custody at 8:03 a.m.

Texas Gov. Greg Abbott said the assailant got a handgun and shotgun from his father, who owned them legally. But it was not clear whether the father knew his son had taken them or if the father could face prosecution. State law makes it illegal to give a gun to anyone under 18, except under the supervision of an adult for hunting or sport shooting.

Pagourtzis, who appeared to have no prior arrests or confrontations with law enforcement, made an initial court appearance on capital murder charges Friday. A judge denied bond and took his application for a court-appointed attorney.

The shooting in Santa Fe, a city of 13,000 people about 30 miles (48 kilometres) southeast of Houston, was the nation's deadliest such attack since the Parkland, Florida, massacre that killed 17 and energized the teen-led gun-control movement. It was also the deadliest assault in Texas since a man with a semi-automatic rifle attacked a rural church late last year, killing more than two dozen people.

Meanwhile, students were being let back inside Santa Fe High School to gather belongings they abandoned when the gunfire began.

The school's roughly 1,400 students were to be allowed inside in groups of no more than 10 accompanied by officers, said Walter Braun, the school district's chief of police.

------

Associated Press Writer Will Weissert in Austin contributed to this report.