By Gary Duffy
BBC Brazil Correspondent
There was a carnival-style welcome for President Lula as he arrived in the favela of Cantagalo, leading off with drums from the local samba school.
More than 18% of Brazil's population live in favelas
Like a lot of people in Rio's favelas or shanty towns, this community has felt left on the margins of Brazilian society for many years.
A presidential visit to a favela is almost a unique event, and most residents appeared to regard the president's arrival as good news.
This district is just a short distance from the famous Ipanema beach, with its upmarket hotels and wealthy apartments, but in most other ways these two communities are worlds apart.
Cantagalo is a sprawling slum, the houses built on the steepest of hills by people who came there from the poorest parts of Brazil seeking work, and over the years it has had its fair share of violence.
Only last week 150 police officers entered the area looking for a suspect in the killing of an Italian tourist. The raid ended in gunfire, something people here have seen many times before.
The higher you go in the favela, and the further you get from the supply of water and electricity, the worse the housing becomes.
Years of neglect
In the local community centre, the president told the residents they deserved better.
"When the rich live on a hill it is chic," he said. "When it is poor people it is considered a favela and shameful.
President Lula has promised to improve living conditions
"So the revolution we are here to announce is to transform where you live into a decent and dignified place that you can be proud of."
Local residents said they believed the president would live up to his promises, and the investment would make a difference.
"It is a pleasure to have the president here," said one man.
"It's the first time a Brazilian president has come to our community. We are very delighted."
One community leader said it made up for years in which little was done to help favela residents.
"The mistake of the government was to neglect the community, so they became marginalised and disorganised," said Luiz Bezerra do Nascimento, President of the Cantagalo Residents' Association.
"The presence of the state was absent - it is (now) arriving late but thank God it is arriving."
Favela residents see regular battles between police and gangs
The work starting in Cantagalo is part of $1.7bn (£800m) programme to improve sanitation, roads and housing in some of Rio's best-known favelas.
But the authorities here are also pursuing a controversial and aggressive policy to deal with drug gangs in these shanty towns, and for the moment it is not clear which approach has the greater priority.
The fact that more money seems to be available is the result of a more stable economy.
"I would say the difference from the past, was in the past there was no money at all and now they have some money, and there is an intention to invest in terms of structural work in the favela," say Milton Feferman, a professor in Architecture from the Federal School of Rio de Janeiro.
Community leaders warn that the investment will only make a difference if the government keeps to its promises.
Many expectations have been raised among the poorest section of Brazil's population and they will watch carefully to see if those hopes are realised.