BHUBANESWAR/MUMBAI, India (Reuters) - At least 39 people were killed and 50 injured on Saturday night when nine coaches of a passenger train derailed in eastern India in the latest disaster to hit the vast and accident-prone state railways, police said.

The Hirakhand express train from Jagdalpur to Bhubaneswar derailed at about 11:20 pm near Kuneri station, in the state of Andhra Pradesh, about 30 km (18 miles) from the town of Rayagada.

“The rescue operation is almost over,” said J.P. Mishra, the chief public relations officer at East Coast Railway, which has jurisdiction over the area where the derailment occurred.

“Our first priority is to take care of the injured passengers and provide proper treatment by shifting them to hospitals. We are also searching all the coaches to ensure that nobody remains stranded in them.”

The reason for the derailment has not been ascertained, Mishra said, adding that they were not ruling out the possibility of foul play and investigations will be conducted. The area in which the incident occurred is one where Maoist rebels typically operate.

Video footage from the scene showed members of the disaster management team and locals trying to rescue trapped passengers from windows and debris using phones to provide light.

“We will take strict action against whoever is behind this act,” said Indian railways minister Suresh Prabhu. “We won’t spare anyone responsible for this accident.”

Slideshow ( 4 images )

Nine bogies were derailed of which three fell off the track, said local Superintendent of Police L.K.V. Ranga Rao, adding that most of the casualties and deaths were from the three sleeper-class compartments.

The track repair operations will go on through the night, East Coast Railway’s Mishra said, adding that he expects train service to be normalised by early Monday morning.

India’s state railways, built during British colonial rule, have an appalling safety record after decades of underinvestment and a priority on keeping fares low for the 23 million passengers who use the network every day.

In the last serious accident, 150 people died when a train derailed late last year in the northern state of Uttar Pradesh. India recorded 27,581 railway deaths in 2014, the most recent year for which figures are available, with most victims falling from, or being struck by, moving trains. [L8N1DN327]

“Anguished to learn about the train accident near Vizianagaram,” Andhra Pradesh, Chief Minister Chandrababu Naidu, said on Twitter, offering his condolences to the families of the victims. “We are investigating the reason for accident.”

Prime Minister Narendra Modi also tweeted that the tragedy was “saddening” and said that the railways ministry was working to ensure quick relief and rescue operations.