RIO DE JANEIRO -- It was supposed to be a triumphant moment for Brazil.
Gearing up for the 2016 Olympic Games to be held here, officials celebrated plans for a futuristic "Olympic Park," replete with a waterside park and athlete villages, promoting it as "a new piece of the city."
There was just one problem: the 4,000 people who already live in that part of Rio de Janeiro, in a decades-old squatter settlement that the city wants to tear down. Refusing to go quietly and taking their fight to the courts and the streets, they have been a thorn in the side of the government for months.
"The authorities think progress is demolishing our community just so they can host the Olympics for a few weeks," said Cenira dos Santos, 44, who owns a home in the settlement, which is known as Vila Autódromo. "But we've shocked them by resisting."
For many Brazilians, holding the 2014 World Cup soccer tournament and the 2016 Olympics on Brazilian soil is the ultimate expression of the nation's elevation on the world stage, and the events are perfect symbols of its newfound economic prowess and international standing.
But some of the strengths that have enabled Brazil's democratic rise as a regional power -- the vigorous expansion of its middle class, the independence of its news media and the growing expectations of its populace -- are bedeviling the preparations for both events.
At stadium sites, construction workers, eager to share in the surging wealth around them and newly empowered by the nation's historically low unemployment rate, are pushing aggressively for wage increases.
Unions have already held strikes in at least eight cities where stadiums for the soccer tournament are being built or refurbished, including a stoppage in February by 500 laborers in the northeast city of Fortaleza, and a national movement of 25,000 workers at World Cup sites has threatened to go on strike.
Construction delays are fueling problems with FIFA, soccer's world governing body. The group's secretary general, Jerome Valcke, said late last week that Brazilian organizers were falling behind, adding, "You have to push yourself, kick your arse." Brazil's sports minister hit back over the weekend, saying Mr. Valcke's comments were "offensive."
Meanwhile, residents in some of the favelas, or slums, who face eviction are pulling together and standing their ground, in stark contrast to the preparations for the 2008 Olympics in Beijing, where authorities easily removed hundreds of thousands of families from the city for the Games.
Favela residents are using handheld video cameras and social media to get their messages across. And they are sometimes getting a helping hand from Brazil's vibrant and crusading news media, arguably the envy of other Latin American countries.
Not only have the news media and newly-created blogs focused attention on the evictions, but they have also dogged officials with their own pursuit of corruption allegations swirling around the Olympic and World Cup plans.
"These events were supposed to celebrate Brazil's accomplishments, but the opposite is happening," said Christopher Gaffney, a professor at Rio's Fluminense Federal University. "We're seeing an insidious pattern of trampling on the rights of the poor and cost overruns that are a nightmare."
Brazil's political culture has done its share in contributing to delays, with corruption scandals involving high-ranking sports officials.
But the favela evictions have struck a particular nerve on the streets. A network of activists in 12 cities estimates that as many as 170,000 people may face eviction ahead of the World Cup and the Olympics. In Rio, evictions are taking place in slums across the city, including the Metrô favela near the Maracanã stadium, where residents who refused to move live amid the rubble of bulldozed homes.
The evictions are stirring ghosts in a city with a long history of razing entire favelas, as in the 1960s and 1970s during Brazil's military dictatorship. Thousands of families were moved from favelas in upscale seaside areas to the distant Cidade de Deus, the favela portrayed in the 2002 film "City of God."
As Rio recovers from a long decline, some of the new projects are largely welcome, like an elevator for a hillside favela in Ipanema, or new cable cars in the Complexo do Alemão slums. Authorities also insist that evictions, when deemed necessary, abide by the law, with families receiving compensation and new housing.
"No one is resettled if not for a very important reason," said Jorge Bittar, the head of Rio's housing authority.
But some favela residents accuse the authorities of contributing to already considerable inequalities. Brazil's economic boom has led to evictions around the country, sometimes independent of the Games. In city after city, favela residents often do not learn their homes could be razed until they are literally marked for removal.
In Manaus, the Amazon's biggest city, residents found the initials B.R.T., referring to a new transportation system, spray-painted on homes to be destroyed. In São José dos Campos, an industrial city, a violent eviction in January of more than 6,000 people captured the nation's attention when security forces stormed in, clashing with squatters armed with wooden clubs.
In Rio, many of the people facing eviction live in the western districts, where most of the Olympic venues will be, and favelas persist amid a sprawl reminiscent of South Florida, with palm-fringed condominiums and shopping malls.
"Brazilian law is adapting to carry out the Games, rather the Games adapting to fit the law," said Alex Magalhães, a law professor at Rio's Federal University.
Organizations formed by favela residents are also using the law and social networking, in a country with the second-largest number of Twitter users after the United States.
One of the fiercest property battles is over Vila Autódromo, the settlement slated for destruction to make way for the Olympic Park.
"Vila Autódromo has absolutely no infrastructure," said Mr. Bittar, the Rio housing official. "The roads are made of dirt. The sewage network goes straight into the lagoon; it's an absolutely precarious area."
Many in Vila Autódromo see things differently. Some have spacious houses that they built themselves. Guava trees shade yards. Some driveways have parked cars, a sign of making it into Brazil's expanding lower middle class.
Residents took their fight online, posting videos of sharp exchanges with officials. They began working with state prosecutors to file injunctions aimed at blocking their removal, though they lost a critical ruling in recent days.
Journalists have weighed in, reporting that Rio's municipal government paid two real estate companies more than $11 million for land to resettle Vila Autódromo's residents; both companies had donated funds to the campaign of Eduardo Paes, Rio's mayor. Mr. Paes denied any wrongdoing but promptly canceled the land purchase.
Still, authorities say they plan to remove the settlement to make way for roadways around Olympic Park, leaving residents scrambling to devise new strategies to resist eviction. "We're victims of an event we don't want," said Inalva Mendes Brito, a schoolteacher in Vila Autódromo. "But maybe if Brazil learns to respect our choice to stay in our homes, the Olympics will be something to celebrate in the end."
Erika O'Conor and Taylor Barnes contributed reporting.
This article originally appeared in The New York Times .