(iStock)

Indiana police responding to a tip said they halted a teenager’s plans to carry out a mass shooting at a middle school, exchanging gunfire with the suspect before he killed himself.

Local officers arrived at Dennis Intermediate School in Richmond, Ind., about 8 a.m., responding to a tip about potential violence. School officials also learned of the tip, and placed the campus on lockdown before police had arrived, Indiana State Police said.

Police said they confronted the teen -- later identified as a 14-year-old -- outside the school. He then shot out a locked glass door and ran in a school building. Officers pursuing the teen exchanged gunfire with him. Police said the suspect was found dead with an apparent self-inflicted gunshot wound, but officials have not determined if he was also injured by gunfire from officers.

No police or students were injured.

Indiana State Police said the tip and quick thinking by school officials, who immediately put the school on lockdown, probably saved lives.

“It is important to emphasize that due to the result of advance notification of the potential for a violent act at the school, the school had initiated their lock down procedure which clearly prevented injury to students and faculty even though the suspect was able to enter the school,” state police said in a news release.

Richmond Community Schools spokeswoman Bridget Hazelbaker said a school resource officer was on duty at the school, but she did not know what role the officer played in the response. The teen suspect was not a student at any school in the district, Hazelbaker said. Richmond is about 70 miles due east of Indianapolis.

The incident was notable for how it unfolded, given how active-shooter situations often end and after recent criticism of Florida authorities for failing to act on tips warning of potential violence. Several schools that endured shootings said a tip was probably the only thing that would have stopped the violence, according to a survey conducted by The Washington Post.

FBI research on active shootings has found that most incidents end when the shooters stop firing, sometimes killing themselves or fleeing. In examining 160 active-shooting incidents between 2000 and 2013, the FBI found that 23 percent ended when the shooters killed themselves before police arrived. In about 28 percent of those cases, shooters exchanged gunfire with law enforcement officials.

The Indiana violence unfolded amid ongoing investigations into authorities' response to the February massacre at a Parkland, Fla., high school and how authorities handled warning signs preceding that rampage.

In Florida, officials learned of concerns that Nikolas Cruz, the 20-year-old charged in the shooting at Marjory Stoneman Douglas High, was a threat to a school but failed to act on the repeated tips, which were explicit in saying Cruz could “shoot up” schools. In an era when the public is encouraged to speak out about individuals they fear could carry out attacks, people repeatedly did that about Cruz but the warnings apparently prompted no follow-up from investigators.

A Florida state commission investigating the Parkland shooting released a draft report this week, concluding that at least 30 people knew about Cruz’s “troubling behavior” before the shooting but those concerns were not reported or prompted no action.

The draft report faulted law enforcement officers for their response to the Parkland shooting, which ended with 17 students and staff dead. The commission said sheriff’s deputies reacted slowly to the gunfire or failed to go inside the school after hearing shots, contrary to the widely accepted police practice of quickly confronting and eliminating attackers during active shootings.

The Trump administration has proposed ways to curb school shootings, including arming educators and “hardening” school sites by adding police officers and greater security measures. Education Secretary Betsy DeVos cleared the way this year for schools to spend some federal grant dollars intended for education on firearms for teachers.