Rioting prisoners in Jordan have released all seven of their police hostages, including the head of the prison service, officials said.
Jordanian officials said 79 Islamists are being held at Juwaida
Maj Gen Awwad al-Khalidi, the assistant director-general of the Public Security Directorate said the crisis was "over".
Clashes broke out at Juwaida prison in Amman, where Islamist militants are being held, after police tried to move two inmates sentenced to death.
Fellow prisoners feared the two men were being taken away to be executed.
The riots at Juwaida began on Tuesday evening after prison authorities tried to transfer the two Islamist inmates.
Yasser Furaihat and Salim Suwaid, who is Libyan, have been sentenced to death for killing US diplomat Lawrence Foley in 2002.
The inmates, who are all suspects in state security cases or prisoners under sentence of death, demanded they all be housed in the same facility.
The Jordanian Public Security Directorate said their request was against regulations and that inmates are normally distributed throughout Jordan's prisons according to set procedures and criteria.
The prisoners, upon being told this, managed to close the prison's main gates and lock police officers and negotiators in with them.
Islamist inmates at two other prisons, Suwaiqa and Qafqafa, also rioted in response to the developments at Juwaida, but Jordanian officials said they were "minor disturbances" that were quickly brought under control.
Gen Khalidi said the crisis at Juwaida was now finished after the release of the head of the prison service, Col Saad al-Ajrami, and two other police officers.
"There are no hostages. The situation was resolved through negotiations and everything is back to normal," he said.
"The situation is under our control."
In return for releasing the hostages, the prisoners were told that they would not be punished, Gen Khalidi said.
The inmates also demanded new trials in civil courts for those who had been convicted and sentenced by military tribunals.
The BBC's correspondent in Amman, Jon Leyne, says Jordan has faced repeated allegations of ill-treatment and torture in its prisons.