A hostage crisis inside a maximum security jail in Indonesia ended after Islamist militant prisoners who "sadistically" killed five police officers surrendered and released an officer they were holding, authorities said.
Officials said the 36-hour standoff that ended with five members of an elite counter-terrorism force dead was an "act of terror".
The riot broke out at the Mako Brimob detention facility in Depok, on the outskirts of Jakarta, on Tuesday evening. A sixth person, a prison inmate, also died.
General Syafruddin, a deputy police commissioner, said the operation had finished and there were no further casualties with all the inmates surrendered.
The majority of the officers, who were members of Indonesia's elite Densus 88, had their throats cut, police said.
More than 150 prisoners were involved in the fatal riot, in which inmates had armed themselves with around 30 weapons, including long-range rifles, taken from officers and a storage area in the jail for weapons confiscated during police operations.
Indonesian president Joko Widodo thanked security forces for their efforts in containing the crisis.
"The state and all the people are never afraid and will never give the slightest room to terrorism and also to efforts that undermine the security of the country," he told a news conference.
Isis claimed responsibility for the clashes at the jail in a message carried on its Amaq news agency, but police have denied any link to the group, saying the riot was sparked by a dispute over food.
Police spokesman Brigadier General Muhammad Iqbal said: "The trigger is trivial, the trigger is the problem of food."
But police also said that some inmates had recently met Aman Abdurrahman, Indonesia's leading Isis sympathiser and alleged mastermind of the 2016 Sarinah bombing. According to his lawyer, he was in another cell block and not involved in the riot.
Last year, an attack by two suicide bombers, using pressure cookers packed with explosives, killed three police and wounded 12 people at a Jakarta bus terminal.
Join our commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies