The Brazilian government has pledged $1.7bn (£850m) to improve conditions in Rio de Janeiro's shantytowns and counter the grip of the drugs gangs.
Shantytown residents have long felt neglected by the state
President Luiz Inacio Lula da Silva said that investing in running water and other basic services was the best way to beat organised crime.
He also defended police action in the slums just days after 19 people died during a major raid against the gangs.
More than one million people live in Rio's sprawling slums.
"If the state doesn't fulfil its role and does not provide (adequate) services for the people, drug traffickers and organised crime will," President Lula said.
"We want people to have road access, street lighting, hospitals and schools."
Such investment, the president said, was the only way to win against organised crime.
The BBC's Gary Duffy in Sao Paulo says the government now seems determined to ensure the drugs gangs cannot take responsibility for services which the state would normally provide.
Rio state security chief Jose Beltrame said last week that slum residents were "at the mercy of a parallel state, where criminals dictate their will".
The scene of last Wednesday's bloodshed was in a Rio district called Complexo do Alemao - or the German's Complex, which had been targeted by police since the start of May.
Rio has an estimated 752 favelas
18.7% of the city's 5.8m population live in favelas
Living conditions are improving. UN figures say 95% of Brazil's urban population has access to safe water supplies, 76% to improved sanitation, and 90% has sufficient living area
Unemployment and crime rates are high, with 360 of Rio's favelas reported to be controlled or influenced by powerful drug gangs
World Bank, UN Habitat
More than 1,000 heavily armed police and special forces went in, backed by armoured vehicles and helicopters.
Residents and human rights groups have criticised such operations and called for better services.
But President Lula defended the tough police stance.
"There are people who think it's only possible to confront criminals with rose petals, by throwing talcum powder. We have to confront the (gangs) knowing that they often they are better armed than the police with more sophisticated weapons."
Groups working with people in the shanty towns welcomed the news of the investment but cautioned that much more needs to be done.
"People have been neglected for so long. Police only go there to intervene and that often turns violent," Ilona Szabo from Viva Rio , an anti-crime organisation working in the favelas, told the BBC.
"Residents don't have any relationship with the police to build trust and prevent violence."
Drug-traffickers thrived on the neglect and marginalisation of the slums, she said. "As soon as the state comes in, the social networks can re-emerge. There is a very strong life in the community that can be mobilised for good and not bad," Ms Szabo said.
Officials say the extra funding announced for Rio's favelas will help around two million families.