A rescuer inspects the damage of Roa-Roa Hotel following a massive earthquake and tsunami in Palu, Central Sulawesi, Indonesia. Picture: AP Photo/Tatan Syuflana, File

Jakarta, Indonesia - Some 1 200 Indonesian convicts are on the run from three different detention facilities in devastated Sulawesi after the region was rocked by a powerful earthquake and tsunami, a justice ministry official said Monday.

One prison in tsunami-struck Palu city -- built to hold just 120 people -- saw most of its 581 inmates storm past guards and escape to freedom through walls collapsed by the massive 7.5 magnitude shake.

"Things were initially fine...but not long after the quake, water erupted from under the prison yard causing prisoners to panic and then run onto the road," said Ministry of Justice official Sri Puguh Utami, adding that the water was not from the tsunami.

"I'm sure they escaped because they feared they would be affected by the earthquake. This is for sure a matter of life and death for the prisoners," she added.

Inmates had fled from another overcapacity facility in Palu by breaking down its main door and another in Donggala, an area also hit by the disaster.

The Donggala jail was set on fire and all 343 inmates were now on the run, Utami said.

The arson was thought to have been sparked by angry detainees demanding to see their families.

"They panicked after learning that Donggala was badly hit by the earthquake," Utami said.

"Prison officials did negotiate with prisoners about allowing them to go to check on their families. But some prisoners were apparently not patient enough and committed the arson."

Some of the convicts were jailed for corruption and narcotics offences, she said. 

Five people convicted of terror-related crimes had been moved from the prison just days before the disaster.

Just over 100 prisoners at the two facilities in Palu were still in jail, but overstretched guards were struggling to keep them fed.

"The prison no longer had enough food," Utami said.

"Officials then tried to buy supplies from stores around the prison that were still open."