(CNN) -- The teen who allegedly used a shotgun and a revolver to kill 10 people at his high school in Texas spared the people he liked during the deadly rampage, a probable cause affidavit says.

Suspect Dimitrios Pagourtzis, 17, has cooperated with police, Galveston County Magistrate Mark Henry said. Pagourtzis told an investigator he acted alone, and spared people he liked because he wanted his story told, the probable cause affidavit says.

He was held without bail and is accused of capital murder of multiple people and aggravated assault on a public servant. Nine students and one teacher were killed, a law enforcement official told CNN.At least 10 people were injured.

Pagourtzis said little during a video court appearance Friday, answering, "Yes, sir," when asked whether he wanted a court-appointed attorney. He was not asked to enter a plea.

The massacre

The gunfire at the Santa Fe High School, not far from Houston in southeastern Texas, started Friday morning. The alleged shooter used a shotgun and a .38 revolver legally owned by his father, Gov. Greg Abbott told reporters.

Gunfire erupted at the school not long after classes began around 7:30 a.m. local time, officials said.

Two school resource officers were on the campus and confronted the shooter, Abbott said.

Authorities later found explosive devices -- including pipe bombs and pressure cookers -- in and near the school, a law enforcement official said.

Henry told reporters that the suspect had devices but none were functional. One was a pressure cooker with an alarm clock and nails, but no explosive material. Authorities also found an unlit Molotov cocktail, he said.

Investigators were searching a trailer Friday, where they believe the devices were assembled, a law enforcement source said.

The Texas governor cited two people being investigated for possible involvement. One person at the shooting scene, initially suspected as a possible accomplice, was questioned and authorities don't believe he was involved.

A second person was also interviewed and investigators don't believe he was involved.

Exchange student among those killed

The victims killed included Pakistani exchange student, Sabika Sheikh, and substitute teacher Cynthia Tisdale.

The people hospitalized included retired Houston Police officer John Barnes, who served as a resource officer at the school.

Houston Police chief Art Acevedo tweeted that he visited him at the hospital, and he was "hanging in there."

This is the 22nd US school shooting so far this year, and the third instance in eight days in which a gunman was on a school campus.

Fire drill and gunshots

Angelica Martinez, 14, told CNN that they heard an alarm as well as gunfire. She and her schoolmates were being evacuated at one point "like it's a fire drill."

"We were all standing (outside), but not even five minutes later, we started hearing gunshots," she said. "And then everybody starts running, but, like, the teachers are telling us to stay put, but we're all just running away."

"I didn't see anybody shooting, but like (the gunshots) were kind of spaced," Angelica said, adding she heard about four shots.

Another student, Dakota Shrader, told CNN affiliate KPRC that she heard gunshots after the alarm blared.

"I was in the history hallway, and as soon as we heard the alarms, everybody just started leaving following the same procedure as ... (a) practice fire drill," Shrader said, breaking into tears. "And next thing you know, we just hear ... three gunshots, loud explosions, and all the teachers are telling us to run."

In a post on Facebook, Houston Police Chief Art Acevedo said he was "not ashamed to admit I've shed tears of sadness, pain and anger" after the shooting.

"I know some have strong feelings about gun rights, but I want you to know I've hit rock bottom," he said, adding he would "de-friend" anyone who posted anything about "guns aren't the problem."

President Donald Trump addressed the school shooting, saying that mass shootings have been "going on too long."

"Unfortunately, I have to begin by expressing our sadness and heartbreak over the deadly shooting at Santa Fe High School in Texas," Trump said. "This has been going on too long in our country. Too many years. Too many decades now."

Trump said federal authorities are coordinating with local officials.

"We grieve for the terrible loss of life and send our support to everyone affected by this absolutely horrific attack," Trump said.