The night back in 2009 that Rio de Janeiro was awarded the right to host the 2016 Olympic games, Erica Portilho sat with her family and watched the ceremony – held in far-off Copenhagen – on TV, in their small home in a hillside favela called Mangueira. And when the envelope was opened and her city's name was read, Ms. Portilho says, she jumped and cheered, like all her neighbours. "This would be a chance for all the world to come here, and know our city, and know our story," she said.

Seven years later, with the Olympics less than a week away, Ms. Portilho recalls that enthusiasm with nostalgia. If she'd known then where Rio would be now, she says – well, there would have been less cheering.

Frantic last-minute preparations are under way across the city – with scaffolding and tenting and road diversions going up everywhere. The visitors have started to arrive: tourists who glance up from a sidewalk and stop dead when they spot the iconic Christ the Redeemer statue, and preternaturally long-limbed athletes who run on the beach in the morning, conspicuous even in this city full of determinedly beautiful people. There is excitement in Rio right now – and also an almost tangible sadness.

Story continues below advertisement

RELATED: Dirty water: Why Rio hasn't kept its promise to clean up

The Olympic Games have been held at difficult moments before – in Los Angeles in the grip of the Depression, in Berlin just after Hitler came to power. But Rio is surely a serious contender for the most vexed Games, a giant party about to roll into a city that is falling apart all around it, its citizens demoralized and anxious and more than a bit rueful that their moment in the spotlight has come when they are so manifestly unable to benefit. "It's a ridiculous feeling – like someone broke into my house to throw a party and didn't invite me," says Ms. Portilho, a 33-year-old fashion designer.

Rio was awarded the Summer Olympics in 2009 – on Brazil's fifth attempt to get the Games – an international mark of recognition for how much the country had achieved. Its economy had grown to be the world's sixth largest, and Brazil had made impressive progress on reducing the inequality that had bedevilled it since the colonizers landed here 516 years ago. Some 35 million people had been moved out of poverty into a fragile but ambitious lower-middle class, through a mix of expanding economic opportunity and progressive social policy. Brazil was flexing growing international influence, and winning the Games – the first country in South America to do it – cemented a new image.

But the Brazil that prepares to play host this week is an almost unimaginably different country than the one that won the bid.

Some of the problems that beset the Games now were predictable – because they seem to be features of every Olympics (such as forced removals and human-rights abuses of vulnerable populations by police) or because of Brazil's stifling bureaucracy and casual approach to timelines. A new metro line is slated to open just days before the opening ceremony; the Athletes' Village is now the site of feverish repair, after the first delegations to arrive pronounced it uninhabitable. Some of the big core pledges in Rio's Olympics bid – such as cleaning up the heavily polluted Guanabara Bay – did not happen, and that doesn't surprise many Brazilians, who have seen politicians pledging to end the pollution for more than 80 years.

But much of what has gone wrong here could never have been predicted: Rio is in the grip of an epidemic of a once-mild virus, Zika, that caused a spike in tragic birth defects and raised fears of other unforeseen neurological effects. A swift-moving, still-unfolding political crisis means a hugely unpopular temporary president will preside over the opening of the Games, even as an impeachment trial of the elected president continues in the capital. The corruption scandal behind the political crisis has ensnared almost every major construction company in the nation, including all of those that worked on the Olympics. An anticipated economic slowdown has spun into a massive crisis, with 14 per cent of people in Rio unemployed.

RELATED: The Globe in Brazil: Zika's ground zero

Story continues below advertisement

The recession has hit the state of Rio – where a third of the budget came from oil revenues – particularly hard. The Games' budget had to be scaled back, but those cuts pale in significance compared to those to state operations and services. Police, firefighters and paramedics stopped getting paid at the start of the year. Public hospitals lack vital supplies. Social service centres for children and the elderly have closed their doors. Money is being poured into infrastructure projects related to the Games – in June the state government begged an emergency loan of $1.2-billion (CAD) from the federal government for Olympic costs. But schools and state universities haven't held classes in months, since unpaid teachers walked off the job.

And yet amidst all this the preparations for the Games have barrelled ahead, as the International Olympic Committee exhibited an almost pathological "carry on!" attitude. Splashy Games-logo statues were installed opposite the shuttered schools; banners reading "A new world!" have gone up opposite hospitals operating on skeleton staff.

Residents of Rio roll their eyes – at best – at those signs. Ms. Portilho says the erosion of her enthusiasm for the Games has been a long, slow process. In a story emblematic of Brazil's changes over the past 15 years, she made the jump into that new middle class, studying fashion design at a technical college, and moving out of Mangueira. In the progressive environment of the last decade, she became an activist on racial equality, and started a community organization to help poor black women advocate for social inclusion.

And as the Olympics drew closer, she made a bid for the group, called Nega Rosa, to reap some benefit. They won a contract to supply 5,770 pillows for the Athletes' Village – cushions in vibrant colours silkscreened with traditional Brazilian plants. It was a chance for the 30 women involved to earn $700 (about a whole months' average wage) and, more important, she says, for them to learn many professional skills, from procurement to delivery logistics.

"This experience was great for the group," Ms. Portilho said a few days ago, looking out over the favela and the city beyond, where the Maracana Stadium (subject of a $500-million renovation and site of the opening and closing ceremonies) gleamed in the distance. "The problem is not the Olympics itself. It's our corrupt politicians, and everything they steal and destroy with the Games as an excuse."

RELATED: RIP Juma: How a dead jaguar could be the latest symbol of Brazil's Olympic woes

Story continues below advertisement

Rio's combative mayor, Eduardo Paes, has boasted for years about how his government has used the Games to bring change. "The Olympics aren't going to be served by the city, the city is going to be served by the Olympics," he likes to say. And some residents agree with him. Lamartine da Costa, a veteran Olympic historian who was born and raised in Rio and has consulted to the Games in locations including Beijing and Athens, says he is happily surprised. "The changes here are even bigger than those in Barcelona – we have a whole new city," he said. Mr. da Costa cites a $3.3-billion refurbishment of the inner-city port area as a key benefit. Once decayed, shadowed by a hulking raised highway, and plagued by crime, the area now boasts a soaring new museum, a light rail system and a square that has fast become one of Rio's favourite public spaces.

But many of the benefits that the mayor likes to cite are controversial. In a city with legendarily atrocious traffic and deficient public transit, a key legacy project he championed is a $3.6-billion subway line (still not open, with five days to go) and dedicated bus corridors. But these, notes urban geographer Renato Cosentino, run from one wealthy neighbourhood to another – and go nowhere near the areas of the city where hundreds of thousands of low-income people spend hours each day commuting on decrepit buses. No coincidence, he says, that the new transit lines, and the Olympic Park, are in the heart of Barra de Tijuca, the wealthy western suburb whose property developers have been key patrons of Mayor Paes's political career.

"They have used the Olympics as an excuse to reorganize the city and create opportunities for property development," he said. "But it's not like London, where they did low-income housing. There's nothing like that." Rio's Athletes' Village, for example, was built by the developer Carvalho Hosken; company chair Carlos Carvalho has said they expect to make as much as $1.3-billion from selling the units as high-end condos in a gated community, once they have been used for the Games for a couple of weeks.

Meanwhile, some 82,000 police and military personnel are now spreading across the city to secure the games, twice the force for the London Olympics four years ago, at a cost of $2.6-billion. That frustrates residents of Rio, as well: security personnel are deployed either in the areas around the games, to keep tourists safe, or to seal off some favelas. Back in 2009, when Rio won the games, the city was in the early days of an ambitious program to introduce community policing into favelas controlled by drug gangs, and for a while, the city's notorious rate of violent crime fell year on year. But so far 2016 has seen a sharp spike in murders, robberies and assaults, the product of both the drop in spending on the initiative (which was meant to have a strong social program component) and of frustration in the favelas with shootings and other abuses by those police, making people unwilling to work with the state.

"They sent police armed to the teeth to do their 'pacifying,' and they brought none of the other things they said they would," said Ms. Portilho. "It's no wonder it hasn't worked. You don't build peace with guns."

Her organization has delivered their pillows to the Games' organizers, and she said the women in the group like to imagine athletes from around the world picking them up, curious about the images of vegetation, this small piece of Brazil. She wants them to see what's good about this place.

Story continues below advertisement

"We in Rio, we know how to welcome people warmly and well," she said. "At least we'll have this."