Indonesian police and soldiers stepped up checks across North Sumatra as they vowed to track down more than 170 convicts - including four terrorists - still on the run after a prison riot in Medan.
The riot saw an office building and main gate burnt, while five people died in the blaze in Sumatra's largest city, including two prison officers.
Officials will soon redistribute prisoners to other jails, and all correctional facilities nationwide have been told to raise their guard against potential riots, Coordinating Security Minister Djoko Suyanto told the media on Friday.
Tanjung Gusta prison's "tremendous overcapacity" demanded serious action, he added.
"The President has also ordered a thorough investigation into the background and motivations for the incident," he said.
This will include looking at whether the riot was planned, he added.
Initial investigation showed that Thursday's riot was caused by inmates angry about a water shortage resulting from a day-long power blackout.
It highlighted the problem of severe overcrowding and overstretched facilities in Indonesian prisons, which are already notorious for regular disciplinary lapses.
And while there were plans to build more prisons nationwide, Mr Djoko said this will take time.
Tanjung Gusta had a capacity of 1,054, but housed 2,600 inmates.
A roll call of prisoners at 4am yesterday found 240 prisoners missing. Police captured 64 of them before noon.
Mr Djoko said 14 terrorists were housed there. Five did not escape, while four who fled were caught.
On Friday afternoon, police spokesman Hilman Thayib confirmed that a fifth terror inmate had been rearrested. Elite counter-terror unit Densus 88 is searching for the other four.
National Counter-Terrorism Agency chief Ansyaad Mbai confirmed that one of the terrorists at large is Fadli Sadama, a key figure in a Jemaah Islamiah (JI) offshoot. He was serving an 11-year sentence for robbing a CIMB Bank branch in Medan in 2010 to finance terror activities.
Several other terrorists were serving time for the same robbery, an attack on a police station, or for being part of a Jamaah Ansharut Tauhid training camp in Aceh.
Fadli was arrested with two handguns in Malaysia in 2010, and was said to be planning a terror attack in Pekanbaru like the one in Mumbai in 2008 that killed 170. Security analysts say he was also a runner for JI bombmaker Noordin Top and was reportedly trying to renew links with old JI networks in the region.
Mr Ansyaad also noted that Fadli and most of the terrorists detained in the prison were disciples of Toni Togar.
Toni had organised several robberies from prison - using guards' cellphones - and is serving a 20-year jail term for JI's Christmas Eve bombings in 2000.
He was at Tanjung Gusta till 2009, and is now at the maximum-security Nusakambangan prison in Central Java.
On Friday, Law and Human Rights Minister Amir Syamsuddin visited the scene and spoke to several inmates behind closed doors.
According to several news websites and TV stations, they were opposed to a new regulation that tightened remissions for crimes to do with corruption, drugs and terrorism.
In Jakarta, Mr Amir's deputy Denny Indrayana said these rules were meant to signal a tougher line on major crimes.
But Antara News Agency reported MP Aboe Bakar Al Habsyi as saying that the incident showed the need for prison inspections "to not just check which inmates had iPads".
"They have to ensure that basic humanitarian needs of inmates, like water and electricity, are met," he said.