The son of a police detective opened fire at a Nebraska high school, wounding the principal and assistant principal and forcing panicked students to take cover in the kitchen of the building just as they returned from holiday break.
The gunman, who had attended the school for no more than two months, fled from the scene and fatally shot himself in his car about a mile (kilometre) away.
Authorities declined to speculate about why the suspect, identified as 17-year-old Robert Butler Jr, targeted the administrators, who were hospitalised.
Jessica Liberator, a sophomore at Millard South High School, said she was in the cafeteria when another administrator "rushed in to tell everybody to get in the back of the kitchen."
She said she started to cry when students heard a knock on the kitchen door and a cafeteria worker yelled for everybody to get down. It was a false alarm. Nobody came in.
She huddled with Brittany Brase, another sophomore. Asked whether they were best friends, Brase said, "No, not really." But, she added: "She's my best friend now. These things bring you together."
Butler had transferred in November from a high school in Lincoln, about 50 miles (80 kilometres) southwest of Omaha.
In a rambling Facebook post filled with expletives, Butler warned on Wednesday that people would hear about the "evil" things he did and said the school drove him to violence.
He wrote that the Omaha school was worse than his previous one, and that the new city had changed him. He apologised and said he wanted people to remember him for who he was before affecting "the lives of the families I ruined."
The post ended with "goodbye."
A former classmate of Butler's from Lincoln confirmed the Facebook post to The Associated Press and provided AP with a copy of it.
Conner Gerner said he remembered Butler as being energetic, fun and outgoing. Gerner said Butler sometimes got in trouble for speaking out too much in class, but he did not seem angry.
Butler's step-grandfather, Robert Uribe, said the news still seemed unreal to him on Wednesday evening and didn't seem to fit with the polite teen he knew.
"I have no idea what led to this," said Uribe, who last saw Butler about a month ago. Uribe said nothing appeared to be wrong at that time.