SAO PAULO (Reuters) - The killing of 56 inmates by fellow prisoners in Brazil’s deadliest jail uprising in decades was a “butchery foretold” by escalating turf wars between drug gangs that threatens to plunge a chaotic penitentiary system deeper into violence.

Men are seen in front of the public jail in Manaus, Brazil, after some prisoners were relocated following a deadly prison riot, January 4, 2017. REUTERS/Ueslei Marcelino

Prior to this week’s massacre of members of the First Capital Command (PCC) in the Anisio Jobim penitentiary in the jungle city of Manaus, security experts warned for months about intensifying clashes in prisons between Brazil’s two most powerful drug gangs - the Sao Paulo-based PCC and the Red Command, based in Rio de Janeiro.

Now they fear the feud will escalate in prisons and on the streets of the South American nation of 207 million people. Rio, Brazil’s most popular tourist destination, is particularly vulnerable, along with major cities in the north and northeast, the experts say.

“This situation is tense, very ripe for new tragedies,” said Camila Dias, a sociologist at the Federal University of ABC in Sao Paulo, who is an expert on Brazil’s prison system and author of a book on the PCC. “This was a butchery foretold.”

For more than two decades, the PCC and Red Command maintained an uneasy working relationship to ensure a steady flow of marijuana, cocaine and guns over Brazil’s porous borders and into its cities.

But in June the partnership ended with the killing of Jorge Rafaat Toumani, a powerful Brazilian drug lord based in Paraguay who controlled trafficking routes along Brazil’s southeastern border.

While Toumani was not publicly affiliated to one group or another, and details of his death remain murky, Paraguayan officials believe he was killed at the PCC’s behest so it could seize his lucrative trafficking routes.

What is clear, security experts say, is that the PCC has taken control of Toumani’s former domain. As a result, relations between the PCC and Red Command fell apart.

Communications between the factions’ leaders obtained by police and leaked in October, revealed a race to become Brazil’s dominant gang. That same month, clashes between gang members in three prisons elsewhere in Brazil’s Amazon left 22 dead.

Control of the drug gangs’ turf has been increasingly balkanized in recent months. That has left the Red Command weaker and allowed the PCC - powered by proceeds from their base in Sao Paulo, Brazil’s richest city - to encroach on their turf in Rio.

Brazilian intelligence services say that in response, the Red Command is strengthening ties with smaller groups elsewhere, like the North Family gang that carried out the slaughter of PCC members in the Manaus prison this week.

Slideshow ( 9 images )

Few now expect the PCC to turn the other cheek after dozens of its members were killed, including many who were decapitated. Videos of the slaughter have spread widely on social media.

“Within the criminal code of conduct, an act like what we saw in the Manaus prison will never go unanswered,” said Rafael Alcadipani, a public security expert at the Getulio Vargas Foundation think tank in Sao Paulo.

He predicts gang battles in prisons across Brazil and on the streets of northern cities and Rio.

“The civilian population will be at the mercy of this coming war,” he said.

Brazil’s justice minister, Alexandre Moraes, and other government security officials have played down such fears, saying they are transferring imprisoned drug gang leaders to maximum security jails, where they will remain in isolation.

In theory this will stop them from handing down orders to underlings, but in the past isolated gang leaders have still managed to retain control over their networks.

DEADLY PRISONS

Whether run by the state, or privately operated facilities like the one in Manaus, most Brazilian prisons lack resources – which allows prisoners to easily take control of them and carry out massacres like the one seen this week. Horrific conditions and abuses are well documented.

There are 622,000 inmates in Brazil’s prison population, ranking only behind the United States, China and Russia, according to the University of London’s Institute for Criminal Policy Research.

Poor financing and administration mean that even in Sao Paulo, Brazil’s wealthiest state, a single guard oversees 300 to 400 prisoners in some prisons, said Dias, the sociologist. “When the prisoners want to have an uprising, they have an uprising,” she added.

The Justice Ministry did not respond to requests for comment, but just last week the federal government announced it was immediately freeing 1.2 billion reais ($372.50 million) in funding for states to improve or build jails.

Sergio Fontes, the top security official in Amazonas state, where Manaus is located, insists the state government has not lost control of the penitentiary system.

Many public security experts disagree. They argue that the prisons mirror an overall lack of security in a country where authorities have long tolerated high homicide rates.