President Lula says the state is making up to Brazil's poorest citizens
There was a carnival-style welcome for Brazil's President Luiz Inacio Lula da Silva when he visited the favela, or shanty town, of Santa Marta in Rio de Janeiro.
The president had come to see at first hand a community struggling to turn itself round.
A major part of that process is a new approach by the state to policing - a process that began late last year.
After an initial violent confrontation with the Red Command - a drug gang that once controlled this district - police have, for the moment at least, established a full-time presence. Normally, they leave the area, with the traffickers still in control.
Speaking exclusively to the BBC, President Lula said the state was making up for a time when it had abandoned its poorest citizens.
President Lula: 'The police are becoming a community force'
"We are working in a way that the state is present in the day-to-day life of poor people," he said.
Police are now aiming to interact more with the favela's community
"In the past it was only the police intervening with lots of brutality which punished the guilty and the innocent - very often only the innocent. Now we have police there, who are becoming a community police force."
He also pointed to the importance of combining this with social improvements.
"We have the biggest investment programme of shanty town urbanisation, basic sanitation and house building that Brazil has ever had.
"When we created our growth acceleration programme in 2007, we invested more than 100bn reais (£30bn) to take care of basic sanitation and build houses."
On a scorching day in Santa Marta, local children do what they can to cool down in the summer heat.
The majority of Santa Marta's residents still live in appalling conditions
An electric cable car takes residents up the steep hill that is home to more than 10,000 people.
Last year, confrontations between the police and the Red Command in this area led to several deaths.
But with the traffickers gone and police maintaining a 24-hour presence, local commanders believe they can now win over hearts and minds.
"Already after a little time you can feel the difference, the community is more open to the military police," said Rodrigo Francisco de Andrada, a commander with the force.
"The police can manage to have a dialogue, to interact more with the community."
But as they move among the warren of streets that make up this shanty town, the armed officers still appear an intimidating presence.
Millions of dollars are being spent to improve Santa Marta
Many locals seem reluctant to criticise the drug dealers, fearing the police will only stay for a short time. They are also wary of this new security presence.
"For some people it is bad - but for me it doesn't make much difference whether the police are here or not," said one woman.
"Because I don't get don't mixed up in anything and they don't bother me."
Alongside the police presence, millions of dollars are being spent to improve Santa Marta.
Houses that were in danger of collapse have been replaced with brightly painted new ones, and there is also a new football pitch, in a country where the game is a passion.
But the majority of people here still live in terrible conditions, which means life is never easy no matter who is in control.
"The people here have to adapt, we have to get by, we have to survive," says community leader Jose Mario dos Santos.
"The rich want peace in order to stay wealthy. We want peace to stay alive. It is simply this."
The calm in Santa Marta is a contrast with the image more often associated with police action in Rio's shanty towns.
Brazil's police are blamed for the deaths of many innocent people
Human-rights groups say security operations often lead to the deaths of innocent people. Police in Rio killed more than 1,300 people in 2007 alone.
While a new approach to policing is being adopted in two of Rio's favelas, the authorities still defend the old strategy as well.
"We don't go into these places to kill people or to cause harm to people," said Jose Mariano Beltrame, Rio's State Secretary for Security.
"We go into these places after our intelligence confirms information about stores of ammunition, drugs and weapons."
In one Rio slum on Wednesday, a police operation against drug traffickers resulted in at least nine deaths.
The statue of Christ the Redeemer - Rio's most famous landmark - looks out over the shanty town of Santa Marta.
It is a relatively compact area that is easier to police than other favelas in the city, a fact which raises questions about how widely this experiment in policing could be tried elsewhere.
However, analysts say the project could indicate a wider shift in policy.
"The government has not accepted publicly that they have changed their strategy," said Ignacio Cano of Rio State University.
"But on the other hand, we see that the number of killings by police is diminishing over the last few months. So I think there has been some kind of a change in the strategy.
"I think the long-term value is that - if it is successful - it will prove to many people that it is possible to diminish violence with those kind of permanent policing projects and with social projects.
Ignacio Cano says the new policing approach could be successful
"We have to understand that traditionally what the police do in Rio de Janeiro, is invade - and they use that word, invade the slums and they kill a few people and then they withdraw.
"So these people who are killed are then substituted by new other people in the drug gangs and the same situation arises again," Mr Cano said.
President Lula's message to the people in Santa Marta was the state is here to stay, but after years of bitter experience it would take time to reassure this community.
The project to improve the lives and the safety of the people who live in Santa Marta has now had a visible expression of presidential support.
But it is also clear that what was possible to achieve in one shanty town will be much harder to repeat in the hundreds of favelas spread out across Brazil's most famous city.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.