As President Lula prepares to leave office with an approval rating of 81%, he leaves a nation looking to the future with hope and a new confidence

Night was falling on Rio's Ipanema beach. Inside the Londra bar at the upmarket Fasano hotel, waiters were making the final adjustments before throwing open the frosted-glass door to the city's most exclusive nightspot.

The bar staff weaved between Sex Pistols-inspired Philippe Starck armchairs shipped in from France. Behind an immaculate bar, stocked with glowing bottles of 12-year-old Glenlivet whisky and buckets of Veuve Clicquot, the cocktail chief showed off his latest creation – a Martini bloody mary topped with scarlet foam.

"This is a 'sceney' place: a place to see and be seen," said Paula Bezerra de Mello, head of PR at what is generally thought to be Rio's most sophisticated hotel. It was, she said, part of the "new luxury" of the Lula era.

As a former trade unionist, Brazil's hugely popular president, Luiz Inácio Lula da Silva, is best known for helping his country's poor during an eight-year reign that is entering its final moments. According to the government, more than 20 million Brazilians have been hauled out of poverty since Lula came to power. But the rich have not done badly either.

Night after night Londra – "London" – is packed with foreign celebrities and the great and good of Rio's high society, who come together to savour some of the most expensive cocktails in town. They dance until gone 3am and enjoy the charms of a place that many see as a key symbol of the "new Brazil": a dynamic nation of talented designers, successful international jet-setters and, of course, beautiful people.

With the economy once again on the move and the Olympics and World Cup on the way, there is a certain something in the Rio air right now; a swagger that can be felt not only in Ipanema's luxurious nightspots, but also in the city's impoverished slums – favelas – and remote Amazonian towns where shopping malls and cinemas are sprouting from the ground with growing pace.

"There is a greater excitement, an optimism," said Rogério Fasano, Brazil's most revered hotelier and restaurateur, who studied film-making in London and conceived Londra as an Italian-tinged homage to his former home. "I feel that people are seeing Brazil in a different way – not just in terms of tourism, but in terms of business," he said.

Many, though not all, attribute this upbeat mood and palpable self-confidence to one man: Lula. According to a poll released on Wednesday, Lula will leave office after two terms with an approval rating of an astronomical 81%.

Today the curtains will begin to go down on the "era Lula". Unless the presidential race is forced into a second round, Brazilians will discover who will pick up where Lula left off.

If polls are to be believed, Lula's successor will be Dilma Rousseff, a former student rebel who rose to be Lula's chief of staff after spending three years in jail under the former military dictatorship. She has a reputation as a respected enforcer entrusted to lead the soon-to-be-ex-president's gigantic economic growth programme, pumping billions into social programmes and infrastructure works.

The new president officially takes over on 1 January, 2011. But between now and then historians will pore over one central question: how did Brazil's first working-class leader achieve such a startlingly vibrant legacy?

For his Workers' party activists and other Lula allies, the answer remains simple. "I am 68 years old and I can tell you that Lula was a president who changed the history of Brazil for the poor and humble," said Benedita da Silva, a Rio politician who was the first African-Brazilian woman elected to the country's Senate. She briefly served as Lula's social development minister before being caught up in a bribery scandal.

Few understand the transformations that Brazil has undergone under Lula better than one of the president's namesakes, a woman who was raised in Chapeu-Mangueira, a Copacabana favela around 10 minutes' drive from Londra, and who has witnessed up close the changes in Brazil's most deprived corners.

"[As a child] I didn't have water. I didn't have electricity. I didn't have a comfortable brick home. Today, these projects are arriving in the communities," she said on Thursday during a campaigning event in Nova Iguaçu, an impoverished town in the rundown suburbs of Rio de Janeiro.

"I know what it means to go hungry. I know what it means to live below the poverty line; to not have water, or electricity, or a school for your child; to not be able to get a job because you have no education or because you live in the favela and no one will give you a job because they are scared."

It was early afternoon and the veteran Workers' party politician – who claims to be a particular fan of President Lula's homemade soup – was busy hunting for votes in a bid to be elected to the Brazilian Congress.

"We haven't come here to speak badly about [other politicians]. We have come to show the work that Lula has done," she told the largely supportive crowds through a crackly PA system.

"People may not like it, but it is the truth. In the history of our country, Lula has been a great president."

Around her the Workers' party activists brandished red-and-white flags that were emblazoned with the slogan: "She's like Lula – she has the soul of the people."

Valdinei Medina, a 29-year-old community leader in the slum where Benedita da Silva was born, was nine when Lula appeared at Chapeu Mangueira shantytown high above Copacabana beach. "He stood right over there under the jackfruit tree," he beamed. "I have a photo of it in the association."

The year was 1989 and Lula, a former shoeshine boy and fiery union leader, had come to this hillside favela as he made his first bid to become Brazilian president.

"People thought: 'Wow! A presidential candidate has come to the slum!'" remembered Medina, a keen Lula supporter. "Back then the slum was complicated. It was something rare. It went down [in our] history."

Lula lost that year and was not elected president until 2002. But millions of impoverished Brazilians, among them many of Chapeu Mangueira's 3,000-odd residents, are certain it was worth the wait.

"It's like Obama said, 'He's the man'," said Medina, just before the start of Brazil's final presidential debate. "Economically things have changed a lot. Before people didn't have phones at home or mobile phones, cars and motorbikes. Today in any favela you go to, the poor man can get these things, can get loans and this is down to Lula, without doubt.

"When Lula took over it was as if the country was coming out of a war. And today things have stabilised. We are no longer known as the country of football and beautiful women. We are known as country that is economically strong."

Lula's support is not universal. Many believe Lula's success, and the country's growing prosperity, owes more to the commodities boom than to any personal merit and warn that a growing government deficit threatens to cause a major headache in coming years. Others attribute Brazil's recent boom to Lula's predecessor, Fernando Henrique Cardoso, who helped stabilise the country's erratic economy in the early 1990s and, perhaps understandably, feels somewhat aggrieved at the lack of recognition.

"I did the reforms. Lula surfed the wave," Cardoso told the Financial Times recently.

But no one can argue with those popularity figures. Back in Londra, Mello was celebrating her country's new financial and cultural renaissance – it is one of the BRIC nations, Brazil, Russia, India and China, which are in the forefront of new economic development – and pondering the outcome of the election: "Right now, Lula could elect this [sachet of] sugar if he wanted," she said, reaching out for the sugar bowl. "That is how much charisma and power he has.

"Everybody referred to Brazil as a sleeping giant, and I think what people are realising now is that we are awake," she explained in immaculate American English. "[Being labelled a] BRIC was a significant positioning … [for people] to realise that there were these four incredibly powerful potential markets. We've always had 'it', and of course the Olympics and the World Cup reiterated that fact," she said. "Now it is official."