AT least 57 prisoners were slaughtered by other inmates during clashes between gangs in the Altamira prison in northern Brazil — with 16 of the victims decapitated.
Many of those who perished were burned alive after being locked in their rooms by lags from rival organised crime groups who set prison wings on fire.
The total number of victims is expected to rise, prison authorities say.
They confirm the riot was the result of a vicious fight between the Rio de Janeiro-based Comando Vermelho and a local criminal group known as Comando Classe.
A spokesman said: "Leaders of the (Comando Classe A) set fire to a cell belonging to one of the prison's pavilions, where members of the (Comando Vermelho) were located."
Fifteen prisoners were found dead at one wing alone, many were strangled or stabbed with sharpened toothbrushes.
State prisons chief Jarbas Vasconcelos said the fire had spread rapidly, with inmates held in old container units that had been adapted for the prison while another building is under construction.
The fire prevented police forces from entering the building for several hours, he told a news conference.
Two prison staff members were also held hostage, but eventually released.
Mr Vasconcelos said: "It was a targeted attack. The aim was to show that it was a settling of accounts between the two groups, not a protest or rebellion against the prison system."
It was a targeted attack. The aim was to show that it was a settling of accounts between the two groups,
State prisons chief Jarbas Vasconcelos
Footage showed thick black smoke rising from the prison compound and people sitting on the roof of a building.
No members of the prison's staff were injured.
Brazil's prison are chronically overcrowded and gang violence, riots and breakout attempts are not uncommon.
The South American country has the third largest jail population in the world after the United States and China.
OVERCROWDED
The prison has a capacity of 208 but is reported to be overcrowded with 372 inmates.
Superintendent Jarbas Vasconcelos said he is launching an investigation into how prison intelligence and surveillance systems failed to anticipate the deadly rampage.
He said: "The unit is old and it houses two criminal factions (Red Command and the Class A Command).
"We had no reports from our intelligence of the possibility of an attack of this magnitude.
“We have 52 dead, including 16 beheaded. It is still very hot inside the prison, and we are working to remove bodies.”
MOST READ IN NEWS
As Brazil's incarcerated population has surged eight-fold in three decades to about 750,000 inmates, the worlds third-highest tally, its prison gangs have come to wield vast power that reaches far beyond prison walls.
Brazil's far-right President Jair Bolsonaro has said he wants to impose tighter controls in the country's prisons, as well as building many more of them.
Bolsonaro's ability to curtail violence, however, may be limited as most prisons are controlled at the state level.
In January 2017, nearly 150 prisoners died during three weeks of violence in several Brazilian prisons as local gangs backed by Brazil's two largest drug factions attacked one another.
Gruesome deaths are not uncommon. In May, at least 15 inmates were found dead, choked to death or stabbed with toothbrushes in the city of Manaus.
We pay for your stories! Do you have a story for The Sun Online news team? Email us at tips@the-sun.co.uk or call 0207 782 4368. You can WhatsApp us on 07810 791 502. We pay for videos too. Click here to upload yours.