Will GOP Rep. Justin Amash win reelection?

Will Joe Biden be the 2020 Democratic nominee?

A student crosses below two flags while entering Antigo High School, Monday, April 25, 2016, in Antigo, Wis. According to police Jakob E. Wagner, 18, opened fire with a high-powered rifle outside of the a prom at Antigo High School ... more >

MILWAUKEE (AP) - The 18-year-old gunman who opened fire on students exiting the prom at his former school in northern Wisconsin was aiming a rifle at a police officer when he was fatally shot, preventing what authorities have said could have been a far worse attack.

The officer who ended the threat was publicly identified for the first time Tuesday as Antigo Police Patrolman Andy Hopfensperger, who had been patrolling the parking lot with two other officers during the dance.

Jakob Wagner was pronounced dead early Sunday at a hospital after the shooting. An 18-year-old male student was struck in the leg and a bullet grazed his date’s thigh as they were leaving. Both are recovering.

Hopfensperger had been “near the victims when they were shot and immediately engaged the shooter, stopping any further threat,” Antigo Police Chief Eric Roller said in a statement.

Roller said previously that his officer “saved a lot of lives” by preventing the suspect from ending up inside the dance.

Landglade County Coroner Larry Shadick confirmed Wagner had taken aim at Hopfensperger. He said the autopsy showed a fatal shot went in through the suspect’s extended left arm and ended up in his chest. “The way this shootout went was just unreal,” Shadick said, explaining that the suspect’s arm would have been outstretched if he were pointing a rifle.

Shadick, citing an ongoing state Justice Department investigation, wouldn’t confirm how many times Wagner had been shot. The toxicology report was pending.

According to a search warrant and supporting affidavit, meanwhile, police seized spent ammunition, a gun sling and journals from Wagner’s home.

Antigo Police Capt. Nate Musolff said in the documents that Hopfensperger fired “as the shooter was actively engaging the kids with the rifle” and that the shooter was hit “multiple times.”

State DOJ spokesman Johnny Koremenos said in an email that it was too early in the investigation to provide details, and authorities haven’t revealed a motive for the attack.

People who knew Wagner have said he was bullied. His mother told The Associated Press on Monday that her son “wasn’t a monster” and that she hopes the tragedy “shines light on bullying and how deeply it affects people.”

Wagner’s family released a statement Tuesday that said his loved ones are “filled with sorrow over the injuries caused to his victims, the position in which the police officers were placed along with the prom goers and their families.”

The statement released by an Antigo funeral home said Wagner’s family realizes “his actions have torn open a wound in our community. We pray for healing.”

According to the documents filed Monday in Langlade County Circuit Court, officers seized several types of spent rounds along with the strap and various journal entries, notes and drawings. They also took electronics, including an iPod, a cellphone and video game systems. Additionally, the records show the seizure of “Notecards Devil In Nature” and “Teen Suicide Reading Materials.”

Hopfensperger is on paid administrative leave, which is routine for officers involved in shootings. He has worked for Antigo Police since January 2013, according to the department’s website.