At least 31 prisoners have been killed in a prison in northern Brazil, just days after 56 died during a jail riot in a neighbouring state.
Thirty of the bodies were found decapitated, officials said.
The local secretary of justice, Uziel Castro, told the BBC he blamed the deaths in the prison in the state of Roraima on a drug gang.
But the situation at the overcrowded Monte Cristo Rural Penitentiary is now under control, he added.
The authorities say the gruesome violence was part of an attempt by the gang to stamp their authority inside the jail and intimidate rival criminal factions.
'Settlement of scores'
Brazil's Justice Minister, Alexandre Moraes, has attributed the violence to a gang known as the PCC (which stands for First Command in the Capital).
"All the victims were from the PCC. It was a settlement of scores inside the organisation," said Mr Moraes.
"Some of the victims were killed because they were rapists; others because the PCC considered them traitors."
Special forces have now regained control of the prison, which is outside the state capital, Boa Vista.
A 2012 government report said the gang was the largest in Brazil, earning $32m (£25.9m) a year in drug sales, with almost half its 13,000 members in jail in Sao Paulo State, where the gang originated.
Officials told local media that a group of prisoners managed to break the locks on their cells in the early hours of the morning and invade a separate wing of the building, which is in the city of Boa Vista.
It is unclear if this latest incident is related to Sunday's riot in Manaus, when PCC members clashed with members of a rival gang, Family of the North (FDN).
The resulting 17-hour prison uprising was the deadliest in Brazil in years. Fifty-six inmates were killed.
Officials say police have managed to recapture 40 of the 87 prisoners who escaped in that break-out.
The Roraima prison was housing more than 1,400 inmates, double its capacity, O Globo newspaper reported.
On Thursday the Brazilian government announced a plan to overhaul security in Brazilian jails.
The plan includes the construction of five new high security jails in Brazil.