Ten people have been killed and the same number wounded after a gunman opened fire at a high school in Texas.
The suspect, 17-year-old Dimitrios Pagourtzis, has been charged with capital murder, Galveston County Sheriff Henry Trochesset said.
He had posted a picture of himself on Facebook wearing a "Born to Kill" shirt, authorities said.
Texas governor Greg Abbott said he used a shotgun and .38 revolver, obtained from his father, in the attack at Santa Fe High School.
Though both guns were legally owned, it is not clear whether the suspect's father knew his son had taken them.
Mr Abbott said the suspect had "information contained in journals on his computer … in his cellphone that said not only did he want to commit the shooting, but he wanted to commit suicide after the shooting".
But Pagourtzis gave himself up, and did not "have the courage" to take his own life, Mr Abbott said.
Explosive devices including a molotov cocktail were found in the suspect's home and a vehicle, Governor Abbott added, as well as around the school and nearby.
"One or two" other people were being interviewed.
A police officer was among those injured.
A Texas hospital said it had treated eight patients. Dr Safi Madain, from Clear Lake Regional Medical Centre, said six of them had since been discharged.
One was in a critical condition, and another in a stable condition.
All appeared to be high school students with gunshot wounds, the doctor said.
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
Student Courtney Marshall, 15, said the gunman came into her art class. She saw at least one person hit.
"I wanted to take care of my friends, but I knew I had to get out of there," she said.
"I knew the guy behind me was dead."
Another student, 18-year-old Logan Roberds, said he heard a fire alarm and went outside.
He then heard two loud bangs, which he did not initially think were gunshots.
Later, he heard three loud bangs. "That's when the teachers told us to run," he said.
He went with other students to a nearby petrol station.
Tristen Patterson, 16, said he considered Dimitrios Pagourtzis to be a friend, adding that Pagourtzis was interested in guns and war simulation video games.
Pagourtzis would sometimes enter the classroom "acting a little bit down or sad, a little bit sluggish", Mr Patterson said. "But he never talked about why."
Father Stelios Sitaras of Assumption of the Virgin Mary Greek Orthodox Church in Galveston, Texas, said he met Pagourtzis when the teenager danced at an annual festival in October.
The priest said he had never heard of the young man being in trouble.
"He is a quiet boy," he said. "You would never think he would do anything like this."
President Donald Trump tweeted: "We grieve for the terrible loss of life, and send our support and love to everyone affected by this horrible attack in Texas."
The shooting, which comes just three months after a similar incident in Florida that saw 17 people killed at Marjory Stoneman Douglas High School, has reignited the debate around gun control.
Singer Katy Perry posted a message to the pro-gun National Rifle Association (NRA), that said: "Dear NRA – Simple fact: our children are more important than your gun business. Sincerely, most of us."
Alongside the message, she wrote: "Add me to the group of most #gunreformnow."
Actor and musician Jared Leto said: "The 3rd school shooting in 8 days and the 22nd this year. At least 8 innocent are dead.
More from United States
"Heartbreaking and senseless and it must stop."
TV host Ellen DeGeneres said: "We can do better than this. We must do better than this".