Brazilian President Michel Temer said Thursday the country will build new prisons in every state to relieve overcrowding after a "horrific" riot that left 56 inmates dead.
It was Temer's first public reaction to the grisly riot in Manaus, the capital of Amazonas state, where jailed gang members beheaded and mutilated their rivals in a 17-hour bloodbath Sunday and Monday.
"I want to first of all express my solidarity with the families that lost their loved ones in this terrible incident," Temer said at a press conference after meeting several of his ministers.
"It's not enough to just diagnose what went wrong. We have to act."
He announced the federal government would spend 800 million reals ($250 million) to build at least one prison in each of Brazil's 26 states to deal with chronic overcrowding blamed for a string of deadly riots.
The new prisons will each have two separate buildings, enabling authorities to separate inmates convicted of minor crimes from the most violent criminals.
The federal government will also build five new maximum security prisons and transfer "highly dangerous" gang leaders to them, Temer said.
High-tech equipment to block cell phone signals -- preventing inmates from using contraband phones for criminal activities -- will be deployed in 30 percent of all prisons in every state, he said.
The latest riot, which also enabled 184 inmates to escape, has cast a spotlight on Brazil's underfunded prisons.
Prisons are often controlled in Brazil by drug gangs, whose turf wars are fought inside as well as outside prison.
Overcrowding exacerbates the problem, human rights activists say.
Brazil's justice ministry said in a 2014 report that the country's prisons need 50 percent more capacity to handle the current number of inmates: 622,000.
That is the world's fourth-largest prison population after the US, China and Russia, according to the report.
The latest riot was the deadliest in Brazil since police killed 111 inmates in a crackdown on an uprising at the Carandiru prison in Sao Paulo in 1992.