NEW DELHI - India’s Railway Ministry said Sunday a “ghastly” accident was narrowly avoided after 22 train coaches carrying some 1,000 passengers became detached from the engine and sped backwards for miles before being stopped.

The runaway carriages in the eastern state of Odisha rolled for 12 km (seven miles) before being brought to a shuddering halt by rocks placed on the tracks by railway staff.

A spokesman for the ministry’s eastern division said none of about 1,000 passengers were injured in the Saturday night incident.

But seven railway employees who did not follow proper procedures have been suspended and an investigation launched into how the carriages became separated during the journey from the western state of Gujarat to Odisha, said spokesman J.P. Mishra.

Authorities believe that brakes applied when carriages are detached or attached to the engine were either incorrectly used or overlooked altogether.

“Something ghastly could have happened and it was averted by alert staff. Safety cannot be compromised,” Mishra said, adding “more heads are likely to roll.”

“Everybody in the railways (ministry) is aghast and shocked.”

Mobile footage posted on social media showed the carriages speeding past a railway platform as helpless onlookers screamed and yelled at passengers to pull the train’s emergency brake.

More than 22 million passengers commute daily on some 9,000 trains across India.

The incident is just the latest to beset the creaking rail network, which dates back to the colonial era.

Last November 13 coaches of an express train derailed in northern India, killing three and leaving nine injured.

A year before that, 146 people died in a similar disaster.

A 2012 government report said almost 15,000 people are killed in various ways every year on India’s railways and described the loss of life as an annual “massacre.”