Omaha, Nebraska: The son of a police detective opened fire at a high school in the state of Nebraska Wednesday, fatally wounding the 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, also wounded the principal before fleeing from the scene and fatally shooting himself in his car.

Authorities declined to speculate about why the suspect, identified as 17-year-old Robert Butler Jr., targeted the administrators.

Vice Principal Vicki Kaspar, 58, died at a hospital hours after the shooting, police said. Principal Curtis Case, 45, was listed in stable condition.

Jessica Liberator, a second-year student 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.

Butler had transferred in November from a high school in Lincoln, southwest of Omaha.

In a rambling Facebook post filled with expletives, Butler warned 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."