Rio De Janeiro — Dozens of relatives of inmates killed during a prison riot in northern Brazil have gathered at a coroner's office to identify the 57 victims. Workers at the forensic institute in Altamira asked local authorities to bring in water, food and medical assistance for the anguished crowd of family members Tuesday.

Authorities said clashes erupted Monday when the local Comando Classe A gang attacked a wing of the prison where members of a rival, Rio de Janeiro-based gang were held. At least 16 of those who died were decapitated.

"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," the statement read.

Get Breaking News Delivered to Your Inbox

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.

Prisoners armed with homemade knives are seen on the roof of a building inside the Altamira prison compound in northern Brazil's Para state, July 29, 2019. Reuters

The fire prevented police forces from entering the building for several hours, he told a news conference. Two prison staff members were held hostage, but eventually released.

"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," Vasconcelos said.

Authorities have not found any firearms following the riot, only makeshift knives.

Prison authorities said 46 inmates will be transferred to other prisons, 10 of which will go to stricter federal facilities.

Brazil's over-packed prisons

President Jair Bolsonaro was elected on the promise of curbing widespread violence in Brazil, including in the country's often overcrowded, out-of-control prisons.

Policemen and soldiers are seen in front of a prison after a riot, in the city of Altamira, Brazil, July 29, 2019. Reuters

The Associated Press obtained a July 2019 report from the National Justice Council that it says was filed by a local judge in charge of the facility, showing that the prison had 343 detainees. It is intended to house a maximum of 163.

Yet Vasconcelos said the situation did not meet the official requirements to be considered overcrowded. "It is not a unit that has a prison overcrowding, we consider overcrowding when it exceeds 210%," Vasconcelos said during the press conference.

The judge who filed the report described the overall state of the prison in the city of Altamira as "terrible."

History of prison riots

In many of Brazil's prisons, badly outnumbered guards struggle to retain power over an ever-growing population of inmates who are able to run criminal activities from behind bars.

The killings echoed those of 55 inmates who died in a series of riots in May in several prisons in the neighboring state of Amazonas.

In early 2017, more than 120 inmates died in prisons across several northern states when rival gangs clashed over control of drug-trafficking routes in the region. The violence lasted several weeks, spreading to various states.

Para state authorities spent the afternoon in Altamira, drafting a security plan to avoid possible retaliations in the region. Police forces from the nearby municipality of Santarem were sent as reinforcement in the coming weeks.

A woman cries after receiving information that her brother was one of the inmates who died during a prison riot, in front of a prison in the city of Altamira, Brazil, July 29, 2019. Reuters

Prison authorities said they had not received any prior intelligence reports of an upcoming attack. The prison is run directly by the state, not a third-party private operator as in the Manaus prisons where the riots took place in May.

Last year, inmates had already set fire to another wing inside the same prison unit, according to the state prosecutors' office.