JAKARTA (AFP)

Indonesia's president ordered an investigation Tuesday after a long-distance train smashed into a stationary commuter train overnight, killing 14 people and injuring dozens.

Officials ended a nearly 12-hour rescue effort near Bekasi Timur station, east of the capital Jakarta, which saw crews prying open mangled carriages following the Monday night collision.

"And this morning... it is all finished," Mohammad Syafii, head of the National Search and Rescue Agency (Basarnas), told a news conference Tuesday. "I am certain there are no more victims to be found."

State-owned rail operator KAI said on Tuesday morning that the death toll had risen to 14.

Another 84 people required medical treatment, it said, without specifying how many remained hospitalised.

According to Franoto Wibowo, a KAI spokesman, a taxi appears to have clipped the commuter train on a level crossing, causing it to come to a standstill on the tracks, where it was hit.

At the station, chaotic scenes unfolded in the aftermath of the crash, with rescue workers shouting for oxygen tanks as ambulances stood by in a snaking queue, lights flashing.

An AFP reporter at the scene witnessed people being carried out of the wreckage on gurneys and loaded into waiting ambulances as hundreds of bystanders looked on, some seemingly in shock.

The military, fire brigade, the national search and rescue agency, and the Red Cross aided in the massive evacuation effort that followed.

President Prabowo Subianto on Tuesday visited hospital patients in Bekasi, offered his condolences to relatives of the deceased, and said he had ordered an "immediate investigation."

He also ordered the construction of an overpass in Bekasi.

"In general, we do see that many railway crossings are not guarded," the president said.

"I have ordered that we immediately repair all these crossings, either by guard posts or by flyovers."

Rescue Efforts

Jakarta police chief Asep Edi Suheri said the long-distance train had crashed into the last, women-only, carriage of the commuter train.

All the victims were in the commuter train, and all 240-odd passengers on the other train had been evacuated safely, according to Anne Purba, another KAI spokeswoman.

The agency said it would cover all medical expenses for the injured and funeral costs for the deceased.

The collision had caused "significant damage to several train carriages", the Jakarta search and rescue agency said in a statement.

Several people were trapped in the carriages "due to the force of the impact," it added.

The rescue agency would not say Tuesday whether all had been freed.