Dozens of inmates have died, with some reportedly beheaded and dismembered, during a series of riots at prisons in Ecuador this week.
Following one of the bloodiest outbreaks of prison violence in the country's history, authorities regained control of the facilities in three cities after raids by hundreds of police officers and military personnel.
According to reports, coordinated fights broke out in the maximum-security wings as rival gangs fought for leadership within the detention centres.
Authorities have said the clashes that began on Monday night were sparked by weapons searches.
The national agency responsible for the prisons said at least 79 inmates had died, including 37 inmates in the Pacific coast city of Guayaquil, 34 in the southern city of Cuenca, and eight in the central city of Latacunga.
The prisons' maximum-security areas tend to house inmates linked to killings, drug trafficking, extortion, and other major crimes.
Deadly prison riots have happened relatively frequently in recent years in Ecuador, whose prisons were designed for some 27,000 inmates but house about 38,000.
Some 70% of the country's prison population lives in the centres where the unrest occurred.
On Tuesday, TV footage showed some prisoners jumping from high walls and others forcing open prison doors, but police and the military stopped them.
Photographs and videos on social media show alleged inmates who had been decapitated and dismembered amid pools of blood.
Security analyst Ricardo Camacho said: "They are disputes between national gangs that seek to monopolise the power that was left vacant in the prisons by the death of a criminal leader in December.
"That has given way to this massacre with violence never before seen. There are prisoners beheaded, dismembered, their hearts removed.
"The prisoners had several hours to do what they wanted, and when the police arrived, they did not put up much resistance."
Prisons director Edmundo Moncayo said two groups were trying to gain "criminal leadership within the detention centres".
Watch the latest from Yahoo News UK