Officers say 17-year-old Dmitrious Pagourtzis, who has been charged with capital murder, has admitted storming an art classroom and killing 10 people.
Charging documents released by police in Santa Fe, Texas, say he avoided students he liked in the rampage, so they would communicate his story afterwards.
The town is grieving for those killed in the attack as investigators try to identify a motive.
The victims of the attack – students aged between 15 and 17 and two teachers – include Sabika Sheikh, an exchange student from Pakistan, who had planned to return home during next month’s Eid celebration to visit her family.
Speaking to journalists from Karachi, her father described the tragedy as a “nightmare” and said he had kept trying to call and WhatsApp Sabika. “Never before had my daughter failed to reply,” he said.
A crowdfunder for the family of 15-year-old Angelique Ramirez, who was described as “a kind, compassionate and caring individual,” raised more than $13,000 in less than a day.
Many of those killed, including Aaron Kyle Mcleod and Jared Black, were in their favourite class, art, when the gunman opened fire on them. Teachers Ann Perkins, 64, and Cynthia Tisdale, 63, were also killed.
The mother of victim Shana Fisher said her daughter had rejected the romantic advances of Pagourtzis in the weeks before the shooting.
The 17-year-old suspect had “continued to get more aggressive” after being turned down by Shana, who “finally stood up to him and embarrassed him”, she said.
Pagourtzis’ lawyer said he knew nothing of the accounts.
Student activists, many of whom mobilised after a mass shooting at Parkland school in Florida earlier in the year, responded to the latest attack by calling for further scrutiny on gun laws in the US.
Devastated beyond words. Our hearts and minds are with every single student, teacher, and family at Santa Fe High School. Congress can stop this. We will keep fighting for our futures and our lives.
— National School Walkout (@schoolwalkoutUS) 18 May 2018
Survivors of the shooting have revealed horrifying accounts of hiding with the bodies of their deceased classmates as the gunman went into four classrooms
Freshman Abel San Miguel said he watched his friend Chris Stone get killed by a gunshot, and said he survived by playing dead after being grazed across the shoulder by a bullet.
“We were on the ground, all piled up in random positions,” he said.
Another student, Breanna Quintanilla, said the suspect had walked into the classroom and pointed his gun at one student, saying “I’m going to kill you” before shooting them.
Texas Governor Greg Abbott said Pagourtzis had planned to commit suicide after the shooting but “didn’t have the courage”.
More from Texas
Gunman shouted ‘surprise’ before Texas school shooting
Hero Southwest pilot Tammie Jo Shults describes ‘flashback’ moment during crash
School to stop spanking pupils on their birthdays after parents complain
Houston man charged with hiring ‘hitman’ to kill ex-girlfriend and three others
Man who cut out woman’s heart and left burned body in children’s pool jailed for life
‘Affluenza’ drink-driver Ethan Couch released from jail after less than two years
He had explosive devices as well as firearms that he obtained from his parents, Mr Abbot said, and had posted photographs wearing a T-shirt that said “born to kill” on Facebook.
Pagourtzis’ family said on Saturday that although they were “in the dark” about the attack, they felt media reports on the massacre were “incompatible with the boy we love”.