Security forces in Indonesia have regained control of a prison on Sumatra Island, which was hit by riots, officials say.
Five people died during the violence, with a search under way for about 100 inmates who had escaped, reports say.
The riot broke out at Tanjung Gusta prison in Medan on Thursday, leaving parts of the jail engulfed in flames.
Police said the violence was sparked by a power cut that left inmates without electricity and water.
Officials say the prisoners broke down the doors of the warden's office, fought with the wardens, pelted rocks and set the office on fire.
Violent skirmishes between police and prisoners led to a number of casualties.
Police say they are now in control of the prison and most of the inmates are back in their cells.
A spokesman for Indonesia's directorate general of penitentiary told the Agence-France Presse (AFP) news agency that officials held a meeting with a group representing the prisoners.
Among those who escaped were a number of prisoners convicted of terrorism offences, police said.
Local officials say at least 55 fugitives have been recaptured, but the exact number of those still at large is not clear.
Police were manning checkpoints on roads around the jail, reports said.
At least two prison staff and two inmates were reported to be among the dead. One report said they had died in a building that was set on fire.
The violence erupted after a power cut knocked out pumps that provide water to the prison, which is home to more than 2,600 inmates - even though it was built to house just over 1,000.
"The prisoners were annoyed by a blackout and problems getting water, which they said happens often at the prison," Heru Prakoso, a spokesman for North Sumatra province police, told AFP.
Indonesia's prisons are typically underfunded and overcrowded. The UK-based International Centre for Prison Studies estimated that in 2012 the Indonesian prison system was at almost 150% capacity.
Last year, the biggest jail on Bali island also saw days of rioting before officials were able to regain control.
Medan is the capital of North Sumatra and Indonesia's fourth-largest city.