A prison riot triggered by gang rivalries in the state of Pará, Brazil, left at least 57 dead – including 16 beheaded – on Monday, leaving authorities to identify the fallen, relocate the culprits, and prevent a revenge attack.

Authorities believe the attackers are members of Comando Class A (CCA), an organized crime gang that has risen in prominence in northern Brazil, where the riot occurred. CCA members reportedly attacked inmates known to be members of the Red Command (CV) gang, initially locking them in a prison annex and setting it on fire. Reports indicate that, in addition to beheading, smoke inhalation appears to have killed the highest number of inmates.

The riot is the deadliest since 1992, but only the latest since May. Brazil has long struggled with prison overpopulation enabling violence, as officials have no choice but to place members of rival gangs near each other and guards are often significantly outnumbered.

Police are reportedly still working on identifying the dead and notifying family members, who have gathered outside of Pará’s Altamira Regional Recovery Center, the prison complex where the riot occurred.

Pará state borders Amazonas, the state where members of the CV and the First Capital Command (PCC), the two largest gangs in the country, engaged in violent assaults on each other throughout 2017. In early 2017, gang members rioted in a prison near the city of Manaus, Amazonas – beheading, dismembering, and cooking each other’s bodies and triggering a prison break in which at one point over 100 inmates went missing.

CV and PCC came to a peace agreement in early 2019 and launched a campaign of violence against the incoming administration of President Jair Bolsonaro, which came to power in part on a promise to sternly combat organized crime. The PCC’s profile, Brazilian news organizations noted on Tuesday, has declined since the peace agreement, giving way for gangs like the CCA to stake claims on its drug operations and the prisons the major gangs control.

The Brazilian newspaper O Globo reported on Tuesday that authorities believe the riot began at 7 a.m. local time on Monday, following the prison’s designated breakfast time. CCA members allegedly went upstairs to a prison annex known to be frequented by CV members, locked them inside, and set the annex on fire. Most of the victims are believed to have suffocated from the smoke, though at least 16 were found beheaded. Authorities have not at press time conclusively determined the timeline of the attacks, including if those beheaded died before or after those who asphyxiated.

The riot reportedly lasted about five hours. Officials have identified 46 culprits to be transferred out of the prison and away from rival gang members. Ten of the culprits are scheduled to be transferred to higher-security federal prisons, as authorities attribute the plotting and execution of the riot to them.

Brazilian authorities are offering the relatives of the dead mental health assistance and tending to families waiting patiently outside the prison for confirmation of their loved ones’ life and health. Folha de Sao Paulo noted that families were loudly sobbing outside the prison as of Monday and made it difficult for a social worker to read out the names of those confirmed dead, as the relatives of the fallen screamed in agony. The list only included 16 names, leaving many waiting outside for more news.

Folha notes that the prison in question was classified as significantly overcrowded and understaffed and lacked basic prison amenities such as classrooms, libraries, and workshops.

O Globo describes Monday’s riot as the deadliest since a 1992 riot that left 111 inmates dead and the fifth major prison riot since January 2017, when the war between the CV and the PCC broke out. On that occasion, members of the CV beheaded at least six members of the PCC on New Year’s Day, 2017, at the Anisio Jobim Prison Complex of Manaus (Compaj) and tossed their bodies over the side of the prison walls as a message to PCC members outside of prison. The inmates also triggered a massive prison break that allowed at least 184 prisoners to escape in Compaj and a nearby prison. Less than a week later, 33 inmates were killed at the Monte Cristo prison in nearby Roraima, 30 of them beheaded and many with their hearts and other vital organs torn out. The victims were members of the Família do Norte (FDN) drug gang, affiliated with the CV.

The prison gang war continued throughout the month. By the end of January, 2017, CV members were filming themselves in prison, using illicit mobile phones, roasting PCC members on makeshift grills and making “churrasco.”

The CV and PCC made their amends in January, choosing the northern state of Ceará as the base for anti-Bolsonaro activities. In January, the gang members joined a third gang, the State Guardians (GDE), and flooded Ceará, spray-painting the message of their truce on city walls and urging imprisoned gang members to cooperate: “My brothers and sisters, we humbly ask you to understand that if any leadership, CCP or CV arrives in our prisons, that the brothers welcome them, give them water, food, toothbrushes, clothes, and sheets.”

The graffiti also commanded gang members to “set off general terror, set fire to banks, post offices, police stations, and overturn bridges and overpasses,” which the criminals obliged.

The truce has not stopped inmates from staging attacks on each other, though it has largely taken the PCC out of the war. The most recent riot before Monday’s, occurring in May, featured rival members of the same gang: the FDN, which has ties to the CV.

Follow Frances Martel on Facebook and Twitter.