The suspected shooter, who was in custody on murder charges, also had explosive devices that were found in the school and nearby, said Gov. Greg Abbott, who called the assault "one of the most heinous attacks that we've ever seen in the history of Texas schools."
Galveston County Sheriff Henry Trochesset says 17-year-old Dimitrios Pagourtzis has been charged with capital murder in the Friday morning shooting, which injured an additional 10 people.
Investigators offered no immediate motive for the shooting. The governor said the assailant intended to kill himself but gave up and told police that he did not have the courage to take his own life.
The deaths were all but certain to re-ignite the national debate over gun regulations, coming just three months after the Parkland, Florida, attack that killed 17 people at Marjory Stoneman Douglas High School.
"It's been happening everywhere. I've always kind of felt like that eventually it was going to happen here, too," Santa Fe High School student Paige Curry told Houston television station KTRK. "I don't know. I wasn't surprised. I was just scared."
MORE: What we know about school shooting suspect
RELATED: How the deadly school shooting unfolded
Michael Farina, 17, said he was on the other side of campus when the shooting began. He heard a fire alarm and thought it was a 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!"
Abbott said "the red-flag warnings were either non-existent, or very imperceptible" in the case of the suspected Santa Fe shooter.
Santa Fe High School, which went on lockdown around 8 a.m. Witnesses said the shooting took place in an art class on campus between 7:30 and 7:45 a.m. Students were evacuated from the building, and backpacks were searched before they were transported to Alamo Gym at 13306 Highway 6 to be reunited with their parents.
The gunman yelled "Surprise" before he started shooting, according to Texas Rep. Michael McCaul, the chairman of the House Homeland Security Committee.
VIDEO: Students escorted out by law enforcement
"We thought it was a fire drill at first but really, the teacher said, 'Start running,'" student Leila Butler said.
MORE: Student's first person witness account
Governor Abbott said that the alleged shooter used a shotgun and a .38 revolver that belonged to his father. Abbott said the suspect has written in journals about planning the shooting and police are talking with two people of interest.
Abbott also said that the shooter had a Molotov cocktail and other explosive devices found in and around the school.
Pagourtzis made his initial court appearance Friday evening by video link from the Galveston County Jail. A judge denied bond and took his application for a court-appointed attorney.
McCaul, a former federal prosecutor, said he expects the Justice Department to pursue additional charges, possibly involving weapons of mass destruction.
President Donald Trump offered his condolences amid the tragedy.
We grieve for the terrible loss of life, and send our support and love to everyone affected by this horrible attack in Texas. To the students, families, teachers and personnel at Santa Fe High School – we are with you in this tragic hour, and we will be with you forever... pic.twitter.com/LtJ0D29Hsv— Donald J. Trump (@realDonaldTrump) May 18, 2018
Trump ordered flags flown at half-staff in memory of the victims. Illinois Governor Bruce Rauner also ordered all state flags be flown at half-staff.
While cable news channels carried hours of live coverage, survivors of the Feb. 14 Florida attack took to social media to express grief and outrage.
"My heart is so heavy for the students of Santa Fe High School. It's an all too familiar feeling no one should have to experience. I am so sorry this epidemic touched your town - Parkland will stand with you now and forever," Marjory Stoneman Douglas student Jaclyn Corin said in a tweet.
She also directed her frustration at President Donald Trump, writing "Our children are being MURDERED and you're treating this like a game. This is the 22nd school shooting just this year. DO SOMETHING."
Friday's assault was the deadliest in Texas since a man with a semi-automatic rifle attacked a rural church late last year, killing more than two dozen people.
There were few prior clues about Pagourtzis' behavior, unlike the shootings in Parkland and the church in Sutherland Springs, Abbott said, but the teen wrote in journals of wanting to carry out such an attack and then to end his own life.
"This young man planned on doing this for some time. He advertised his intentions but somehow slipped through the cracks," Cornyn said.
In the aftermath of the Florida assault, survivors pulled all-nighters, petitioned city councils and state lawmakers, and organized protests in a grass-roots movement. Within weeks, state lawmakers adopted changes, including new weapons restrictions.
In late March, the teens spearheaded one of the largest student protest marches since Vietnam in Washington and inspired hundreds of other marches from California to Japan.
The calls for tighter gun controls have barely registered in gun-loving Texas - at least to this point.
Texas has some of the most permissive gun laws in the U.S. and just hosted the NRA's annual conference earlier this month. In the run-up to the March primary election, gun control was not a main issue with candidates of either party. Republicans did not soften their views on guns, and Democrats campaigned on a range of issues instead of zeroing in on gun violence.0
The Associated Press contributed to this report.
WLS-TV contributed to this report