A bloody clash between two prison gangs on Monday left at least 57 inmates dead with 16 of them decapitated, authorities in the state of Para said, the latest deadly clash as Brazil's government struggles to control the country's overcrowded jails.
State authorities said the riot began around 7am local time (1000 GMT) at a prison in the northern city of Altamira, and involved rival gangs.
Prisoners belonging to the Comando Classe A gang set fire to a cell containing inmates from the rival Comando Vermelho, or Red Command, gang, Para's state government said in a statement.
Most of the dead died in the fire, they said, while two guards were taken hostage, but later released.
"It was a targeted act," state prison director Jarbas Vasconcelos said in the statement, adding there was no prior intelligence that suggested an attack would take place.
"The aim was to show that it was a settling of accounts between the two gangs."
Videos circulating online showed inmates at the prison celebrating as they kicked decapitated heads across the floor.
Elected on a tough-on-crime message, far-right President Jair Bolsonaro has benefited from a sharp drop in homicides so far this year. Nonetheless, endemic prison violence has been a stubborn public security challenge in one of the world's most violent countries.
In May, at least 55 inmates died during prison attacks in the northern state of Amazonas. Weeks of violence in Amazonas in 2017 resulted in 150 prison deaths as local gangs backed by Brazil's two largest drug factions went to war.
Brazil's justice ministry said in a statement that it was working with Para authorities to identify those behind the latest attack, adding it had opened some space in the federal prison system where those gang leaders would be transferred.
Brazil's incarcerated population has surged eight-fold in three decades to around 750,000 inmates, the world's third-highest tally. Prison gangs originally formed to protect inmates and advocate for better conditions, but have come to wield vast power that reaches far beyond prison walls.
The gangs have been linked to bank heists, drug trafficking and gun-running, with jailed kingpins presiding over criminal empires via smuggled cellphones.
In the country's violent northeast, prison gangs have grown powerful by moving cocaine from Colombia and Peru along the Amazon's waterways to the Atlantic coast, where it heads to Africa and Europe. Murderous disputes often arise as they clash over territorial control.