An armed teenager killed himself inside an eastern Indiana middle school Thursday morning after officers confronted him, a spokesman for the Indiana State Police said.

ISP tweeted no other students were reported injured in the shooting at David W. Dennis Intermediate School in Richmond.

ISP Sgt. John Bowling said the quick response by local police and middle school staff likely prevented other students from being injured. Bowling said gunshots rang out during the incident but he did not confirm how many bullets were fired or say who fired them. He also did not confirm the student's age or if he was enrolled in the school.

Authorities received an alert Thursday morning that someone was going to the school with the "intention of hurting people," and officers arrived at the building about the same time as the teen gunman, leading to an exchange of gunfire, the Palladium-Item reported.

Richmond Community Schools tweeted that students at the middle school were being taken to Richmond High School, where parents could pick them up.

INDIANA BOY, 16, ARRESTED IN KILLING OF PREGNANT HIGH SCHOOL CHEERLEADER

“Once all Dennis students are accounted for, we will begin the reunification process,” Richmond Community Schools tweeted. “Dennis students will be transported to Richmond High School. Parents will be reunified with their Dennis student at Civic Hall.”

The school district later tweeted other schools resumed classes.

MAN PLEADS GUILTY AFTER ARREST IN INDIANA GIRL’S COLD CASE MURDER SOLVED VIA DNA WEBSITE

Parents were seen waiting at Richmond High School to take their children home.

“It was terrifying. My daughter had just walked in, and I thought she would be a target in the hallway,” parent Pam Sexton told the Palladium-Item. “I’m still shaking. I can see it on the news, but it’s scary when it’s your own baby.”

Dennis Intermediate School serves students from grades five to eight, according to its website. Richmond is near the Indiana-Ohio state line and about 60 miles east of Indianapolis.

The Associated Press contributed to this report.