The Brazilian authorities are poised to send the army into the slums of Rio de Janeiro less than three months before the World Cup. The move follows attacks on police that have resulted in the most tense standoff for years in the favelas.

The Rio state governor, Sérgio Cabral, has requested the reinforcements after assaults on police bases, apparently co-ordinated by the city's biggest gang, Comando Vermelho.

An escalation of murders, revenge killings and fire-bombings have prompted talk of a war between the police and gangsters. Favela residents and NGOs say the situation is now more tense than at any time since 2010, when the authorities began a "pacification" programme to regain control of communities from armed traffickers.

The government is expected to announce details of the military deployment in the coming days, before the expected arrival in June of hundreds of thousands of football fans, players and support staff for the seven World Cup matches that will be held in Rio.

The pacification campaign is a crucial element in the city's preparations for the tournament. Since it started, 38 police pacification units (UPP) have been established in favela communities, which are now occupied by more than 9,000 police.

Until last year, the gains in public security were evident. But confidence in the programme has been sapped by a series of human rights abuses by police officers.

Sensing a swing in public opinion, imprisoned Comando Vermelho leaders are said to have ordered their members to go on the attack.

Five police officers have been killed since February. The most recent of them was an officer shot in the throat during an altercation with two youths in a favela at the weekend.

Last Thursday, police posts in three favelas were set ablaze. The Mandela UPP – located in the Manguinhos complex, which was visited by Pope Francis last year – was gutted, two police cars were set ablaze and several other units attacked. Rio's political leaders say the attacks are co-ordinated.

Police guard the crime scene where an officer shot by criminals on 14 March. Photograph: Fabio Teixeira/Pacific Press/BI

"It is clear that criminals want to weaken our policy of pacification and take back territories that were in criminal hands for decades," said Cabral, who will meet Brazil's president, Dilma Rousseff, on Friday. "The state will not back down. The public may be sure we shall act."

Residents say revenge killings by police death squads are on the rise. The most recent occupation resulted in two deaths as police moved into the favela communities in Manguinhos, Lins and Alemão on Friday night. Military police spokesman Lieutenant Colonel Claudio Costa said the killings occurred when police confronted drug traffickers. Those trapped in the middle fear a return to the bad old days.

"It's definitely more tense than at any time since the UPP began," said Hercules Ferreira Mendes, president of the Caracol residents association, which represents 8,000 inhabitants in Penha. "The traffickers are trying to take back the territory they held for so long. People are afraid to stay out at night. The later it gets, the more shootings and confrontations you hear. Nobody knows what will happen next."

Although the biggest impact is felt by residents, the increased tension is likely to worry World Cup organisers. Many of the million or so fans expected for the tournament along with many national teams will pass by the Penha and Maré favelas on their way to and from Rio's international airport. The Nossa Senhora da Penha church, perched high on a nearby hill, is one of the most visible sights on the road.

The reasons for the surge in violence are disputed. Police blame drug traffickers for the new offensive. Others say the main problem is that pacification has not been followed by improvements in social services and infrastructure despite promises from politicians.

Adding to the tension are human rights violations by police, which add to the widely held impression in the favelas that they are no better – and often a lot worse – than the gangsters they replaced.

Last week, passersby recorded video of a police car dragging an injured woman along a street after the officers had thrown her in the boot. Mother-of-four Claudia da Silva Ferreira died soon afterwards in hospital.

Many trace the start of the current increase in violence to the torture and apparent murder of Amarildo de Souza, who disappeared after being given electric shocks and asphyxiated during questioning by UPP officers in the Rocinha favela last July. Despite the arrest of the local police chief and more than a dozen officers, the case severely eroded public trust in the pacification mission.

"I knew at that moment that the UPP was finished. If I were a bandit, I would think 'great'. It was like a bomb that blew up everything," said Yvonne Bezerra de Mello, of the Uere Project, which educates children in the Maré favela community.

"The gangs have been very quick to reorganise. They're very good at training their troops. Now our city is completely out of control."

However, official statistics suggest the city has seen worse. Murder rates and gun crimes remain well below the peak of the mid-2000s. But armed robberies are back on the rise and with both sides in the drug war preparing for an escalation, long-time observers warn that the risks of even deadlier clashes are on the rise.

"It's on course to be the worst it's ever been," said Nanko van Buuren, a Dutchman who has worked in Rio's favelas for 25 years and whose Ibiss foundation runs programmes in 68 communities.

"I think when the federal troops arrive, there'll be a war in some areas. If it doesn't go well, we'll also see protests during the World Cup."

Although the spotlight is on Rio, this is by no means the most dangerous of Brazil's cities. According to a recent study by the Mexico-based NGO, Citizen's Council for Public Security and Penal Justice, Brazil has 16 of the world's 50 most murderous cities – more than any other country. Six of those cities will host World Cup games – Fortaleza, Natal, Salvador, Manaus, Recife and Belo Horizonte. Rio does not even make the list.