RIO DE JANEIRO — After the flames were extinguished and guards regained a semblance of control over the prison in northern Brazil where a gang fight left 57 dead, officials encountered a macabre scene.
The severed heads of 16 inmates lay on the concrete floor, surrounded by cigarette butts and puddles of blood. Nearby were another 31 bodies of prisoners who succumbed to smoke inhalation.
The clash between rival gangs at the detention facility in Altamira, in the state of Pará, on Monday was the deadliest outbreak of violence behind bars in Brazil in nearly three decades. But it came as little surprise to experts who have watched the country’s inmate population explode as powerful gangs assert ever more control over the teeming detention facilities.
“Altamira was a tragedy foretold,” said Anna Isabel Santos, a public defender in Pará. “It was a packed prison that hadn’t been upgraded in a decade where two rival gangs were being held side by side.”
Brazil has more than 811,000 inmates — a population that has grown sharply over the past decade, overburdening the federal and local corrections systems.
As of 2017, jails and prisons in Brazil were operating so over capacity that, on average, a space designed to hold 10 prisoners was holding 17, according to data from the Justice Ministry.
The situation in the state of Pará was particularly acute, according to government statistics. From 1995 to 2018, the inmate population ballooned from 1,153 to 16,505. While the penitentiary system has added bed space, as of last year it was equipped to hold only 7,950 inmates.
As a growing number of people have been funneled into saturated prisons across the country, Brazil’s powerful drug cartels and their regional offshoots have taken advantage of the mayhem, according to officials and experts.
Prisons have become recruiting centers and operational hubs for drug gangs that control profitable cocaine routes originating in Colombia, Peru and Bolivia. Brazil is one of the world’s largest cocaine markets and an important way-station for shipments that end up in Europe and Africa.
“They’ve essentially become transnational corporations with terrific logistics,” Augusto Heleno Ribeiro, a former Army general who oversees security policy in Brazil, said in an interview earlier this year. “There is much they control today from inside prisons.”
Brazil’s largest drug gangs, the Red Command and the First Capital Command, were formed behind bars decades ago with roots in Rio de Janeiro and São Paulo, respectively.
Over the past few decades, the groups morphed into behemoths with regional offshoots and affiliates abroad. The Brazilian government has responded mainly by locking up more people, which experts say has worsened the violence.
“Mass incarceration swells the ranks of prison gangs by filling up prisons with potential new recruits who find themselves in terribly overcrowded and dangerous prisons, in need of protection,” said Benjamin Lessing, a political science professor at the University of Chicago who studies the drug trade in Latin America.
Mr. Lessing said prison officials in Brazil have often been conflicted about segregating prisoners according to gang affiliation. The practice, which has become routine in much of the country, often strengthens gangs and can exacerbate overcrowding in some areas.
In Pará, gang segregation has become so routine it is directly handled by criminal judges, said Ms. Santos, the public defender.
“When you go to a hearing the judge asks what gang the inmate belongs to in order to know where to send them,” she said. “Those who do not belong to a gang will end up getting affiliated based on what the judge decides.”
Monday’s clash began when members of Comando Classe A, a regional affiliate of First Capital Command, set fire to the cell of inmates from the Red Command, according to officials. Two guards were held hostage during part of the confrontation, but they were released unharmed.
Ronivia Teixeira Pontes, a teacher in Altamira whose brother was among those killed, said corrections personnel could have stopped the bloodletting.
“Everybody knew this was bound to happen,” she said in an interview on Tuesday. “They go into prison armed with large and small knives. How can officials say to relatives that they are blameless?”
In response to the massacre, the federal government said it would transfer leaders of the gangs involved in the clash to more secure facilities.
Asked about the violence, President Jair Bolsonaro, who has endorsed tough-on-crime policies, had little to say on Tuesday. “Ask the victims of those who were killed in there what they think,” he told journalists.
Outside the prison, relatives gathered on Tuesday to take custody of the bodies of their loved ones. The decapitated heads were placed together in a large black plastic bag, along with a couple of arms that had also been severed. The scene and the smell in the air were so revolting that some family members vomited.
“I have never seen so much barbarity in my life,” Ms. Teixeira said.