(CNN) - A teenager was en route to an Indiana middle school Thursday to commit an act of violence, but police were able to stop him after receiving a tip, state police said.
The 14-year-old exchanged gunfire with police at Dennis Intermediate School in Richmond before killing himself, Indiana State Police Sgt. John Bowling told reporters, citing preliminary results of an investigation.
"Someone knew something, and they said something," the sergeant said, attributing the fact that no students were hurt to the tipster.
Richmond Community Schools received the tip, notified police and put all of its schools on lockdown before the police or gunman arrived, district spokeswoman Bridget Hazelbaker said.
Richmond police alerted area law enforcement to the potential for violence at Dennis Intermediate, state police said in a statement, and when officers arrived they confronted a teen "who then reportedly shot out the glass of a locked entry door to the school, and ran inside with police officers in pursuit."
Inside the school, the teen exchanged gunfire with police before fatally shooting himself, authorities said. It isn't clear whether police injured the teen before he took his own life.
"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 (its) lockdown procedure which clearly prevented injury to students and faculty even though the suspect was able to enter the school," the state police statement said.
Bowling said it was unclear how many shots were fired or why the teen was targeting the middle school.
The suspect was a former student in the district, Hazelbaker said. It was not clear which school he attended.
Students were transported to Richmond High School, about a mile away, and parents were told to pick them up at the adjacent Civic Hall Performing Arts Center, the district said.
Dennis Intermediate is in a residential neighborhood in the city of about 37,000. Richmond is near the Ohio border, about 70 miles east of Indianapolis.