Image copyright CBS

Indiana police say a phone tip has helped prevent an armed 14-year-old from committing a school shooting.

As the student was en route to the Dennis Intermediate School on Thursday, the Richmond school district received a warning call and initiated a lockdown.

"Someone knew something, and they said something," Indiana State Police Sgt John Bowling told reporters.

No students were injured and the suspect died from an apparent self-inflicted gunshot wound, police say.

The incident occurred in Richmond, Indiana, 70 miles (110km) east of Indianapolis, on Thursday morning as classes were just beginning for the day.

Image copyright CBS Image caption Police say the attacker shot out a window after finding the door was locked

As the attacker arrived at the school, he was confronted by police who had rushed to the scene after school officials had alerted police to the phone tip.

When the shooter tried to enter the school, he found the doors locked and shot out a window to get inside.

He then "ran inside with police officers in pursuit," Indiana State Police said in a statement.

After exchanging fire with police, the suspect was found in a stairwell from what police believe was a self-inflicted gunshot wound.

Police have yet to release the attacker's name, potential motive, how many weapons he was carrying or whether he may have been injured by police before killing himself.

According to a school district spokeswoman, the student had been a student in the district, but it was unclear at which local school.

Image copyright CBS Image caption The tipster is being praised by police for having prevented a tragedy

"How thankful I am that all of our students are safe; all of our staff members are safe," said Richmond Community Schools Superintendent Todd Terrill.

Indiana State Police say the tipster's call gave them valuable time to lock down the school.

Media playback is unsupported on your device Media caption The American teachers armed against gun crime

"It is important to emphasise that due to the result of advance notification of the potential for a violent act at the school, the school had initiated lockdown procedure which clearly prevented injury to students and faculty even though the suspect was able to enter the school," the police statement added.

A woman who lives near the school told CBS that she spoke to the suspect's father, who said that "his son took all of his guns this morning" and forced him to drive him to the school.

A local ABC News affiliate reports that the tip came from the suspect's mother, but police have yet to confirm the identity of the caller.

Classes have been cancelled for Friday and Monday at the Dennis Intermediate School.

The foiled shooting occurred one day before the six-year anniversary of one of the worst school shootings in US history at Sandy Hook Elementary School in Connecticut.

That attack left dead 26 people - 20 under the age of seven - at the hands of a 20-year-old assault rifle-wielding gunman, who investigators have recently said had felt a "scorn for humanity".

On Friday - the day of the anniversary - classes were cancelled at Sandy Hook after the school received a bomb threat.