An 18-year-old gunman who opened fire with a high-powered rifle outside a Wisconsin high school prom, wounding two youngsters before being killed by a police officer, intended to carry out a shooting rampage inside, a school chief has said.
Investigators would not say whether Jakob Wagner targeted the wounded teenagers specifically, or discuss a possible motive for the shooting outside Antigo High School late on Saturday.
But a school administrator said it appeared Wagner, who was shot in the school car park, intended to go into the dance and start shooting randomly.
The two wounded people, a pupil and his prom date, who was not local, were shot as they left the building, said Eric Roller, chief of police in Antigo, a community of about 8,000 people about 150 miles north of Milwaukee.
"Officers were in the parking lot patrolling the activities and heard the shots and an officer immediately fired upon the shooter, stopping the threat," he said.
Wagner was taken into custody but died later at a hospital.
The Unified School District of Antigo said Wagner approached the school with a high-powered rifle and a large ammunition clip and the "quick actions" taken by police and district staff to secure the building "prevented what might have otherwise been a disaster of unimaginable proportions".
Interim district administrator Donald Childs said it appeared Wagner intended to go into the building and shoot at people at the dance.
"We have no reason to believe at this point it was targeting anybody specifically," he said, adding that the shooting outside the entrance happened "from some distance".
The girl was treated for graze injuries and the young man was undergoing surgery for non-life-threatening injuries, police said.
Nikita Deep, 16, who is class president at the school and was involved in organising the prom, told the Wausau Daily Herald that police came into the building and moved students to one corner.
They were were not released until about 2am on Sunday, three hours after the shooting.
"We heard there was a situation, but I thought it was some kind of drug bust," she said. "Then they flipped the lights and then about 12 officers came in and are armoured. We were all frightened."
State governor Scott Walker said the actions of the Antigo Police Department "undoubtedly saved lives".
Friends said Wagner was a senior at the school in 2015, but Mr Childs said he did not graduate with his classmates and was continuing to work on his diploma. He said counsellors would be at the the school of about 750 students when classes resumed on Monday.
Friends expressed shock that Wagner was the gunman.
"For him to do that, something just isn't right. He was a good kid," said Dakotta Mills, who said he had known Wagner since sixth grade and considered him a "foster brother".
He said Wagner was interested in guns and wanted to become a hunter, but he was not sure Wagner could afford a gun. He said Wagner was raised by his mother and grandparents and was still living at home.
He loved video games and music, particularly the violin and cello, and had been in the school marching band, his friend said.
Dylan Dewey, who graduated from the school last year, said Wagner had been dating a girl at the school who broke up with him last month. He described him as an "all-around good guy" who enjoyed being with his friends.
The Wisconsin Department of Justice's criminal investigation division has been asked to lead an outside review of the officer-involved shooting.