Ecuador's president has declared a state of emergency in the prison system after rioting killed 116 people earlier this week.
The order was issued by President Guillermo Lasso.
It will give the government powers that include deploying police and soldiers inside prisons.
The action came after a deadly battle Tuesday night between gang members at the Litoral prison in the port city of Guayaquil.
The riot killed 116 people and injured 80 more.
Officials said at least five of the dead had been decapitated.
The prison has experienced a series of bloody clashes in recent months.
But the latest fighting was the deadliest act of violence ever reported in Ecuador's prison system.
Officials blame the clashes on gangs linked to international drug organizations who are fighting for control.
Lasso told reporters what had happened at the prison was "bad and sad."
He said he could not guarantee that officials had been able to regain control of the prison.
"I ask God to bless Ecuador that we can avoid more loss of human life," Lasso added.
"It is regrettable that the prisons are being turned into territories for power disputes by criminal gangs," Lasso said.
He promised to act with "absolute firmness" to regain control of Litoral and to prevent the violence from spreading to other prisons.
Images shared on social media showed many bodies inside the prison in battle-like settings.
Officials said rioters had used guns, knives and bombs during the fighting.
Family members of the victims arrived at the prison to seek information about relatives and demand accountability from officials responsible for safety.
The government increased the military presence outside the area.
Lasso said the state would assist the families of dead and injured prisoners.
Similar clashes took place in February and July of this year in different prisons throughout the country.
At least 79 people died in the February violence, while 22 were killed in July.
The Inter-American Commission on Human Rights has condemned similar violence in the past.
Human Rights Watch urged Ecuador's government to fully investigate the latest prison violence and bring those responsible to justice.
In August, Lasso said the government would provide more money to help deal with overcrowding issues and for new equipment to improve security.
I'm Bryan Lynn.