The World Cup has a Brazil problem.                                                      Photographer: Mario Tama/Getty Images
The World Cup has a Brazil problem.                                                      Photographer: Mario Tama/Getty Images

The other day I stopped into my neighborhood bistro for a bite. It's usually a laid-back place, with a great jazz soundtrack, but when two guys in dark suits walked in, the mood chilled. They were "fiscais" -- Rio shorthand for city inspectors -- snooping for irregularities. Proprietors in Rio de Janeiro dread these sorts of visits: Fiscais always find something. They might be persuaded to look the other way, for a price. Brazilians call it wetting the official hand.

With Brazil in the global headlights, and 600,000 foreigners expected for next month's World Cup, hands are getting wetter. "My blood freezes when I see them," whispered the bistro manager as the suits marched into the kitchen. "You work hard, follow the rules and still you get taken advantage of. Makes you want to join the protests."

Plenty of Brazilians have done just that. Organized labor is seething, with teachers, bus drivers, bank tellers and police staging strikes. Squatters seize empty buildings while slum dwellers ignore orders to evacuate neighborhoods slated for sports arenas. On any given day, the air is thick with smoke from city buses that irate protestors set ablaze. What happened to the sunny country that was the talk of the emerging markets and claiming its place on the global stage?

Brazilians are sore in part because their country has changed, and mostly -- odd as it may sound -- for the better. The assets that made Brazil the toast of Latin America and a rising powerhouse are real. The country is a stable, flawed, but functioning democracy. It's got the scrappiest press in the continent, and judges with minds of their own. Last year, the Supreme Court defied political rainmakers by convicting 25 politicians, bankers and businessmen in a huge political payola scandal.

Forty years of ginning sugarcane into ethanol have made Brazil the benchmark for clean-burning fuels. The cheap and simple cash-transfer program, Bolsa Familia, which costs a trifling half percent of gross domestic product, is now a template for poverty-busting in the developing world. Brazil even managed to combine economic growth with falling inequality, a rarity in the emerging markets where booms generally widen the wealth and income gap.

Brazilians, though, are quick to point out that these gains are halting and partial, and they have little patience for the all-boats-rising hype of the official spin cycle. In a recent poll, 68 percent of Brazilians said they wanted "deep changes" in the way the country is run. That kind of unhappiness drove tens of thousands into the streets last year to rail at everything from shoddy public services to light-fingered bureaucrats.

As discontent flares, the danger is that policies that work get tossed out with the broken. One of the keystones to progress in Brazil's cities, for instance, is pacification. Since 2008, security forces in Rio have "pacified" 38 of Rio's most notorious urban slum complexes where gangs made the rules and kept half a million "Cariocas," as Rio natives call themselves, under the yoke. As Rio goes, so goes Brazil. That's why the country has watched closely as Rio has struggled to restore peace.

Pacification has driven down lethal crime across Rio. Inner city homicides dropped 38 percent in the first quarter of the year compared with the same period of 2008, though murders have jumped in the flatland suburbs. In pacified zones, murders also fell 26.5 percent in 2013 from the year before.

And yet as pacification spreads, the police have been stretched, and have themselves become targets: 16 have been gunned down on duty this year, three in "pacified" areas. But often cops are the problem. Police killed 85 people in the first three months of this year, more than double the number of the first quarter of 2013.

One of the casualties was Amarildo de Souza, though not officially so. Last July, the construction worker was picked up for questioning in Rocinha, a large favela, and never seen again. His disappearance (he's presumed dead) triggered a national outpouring, with artists and soap opera stars turning "Where's Amarildo?" into a street meme.

The anger suggests that community protection has hit a wall. Yet Rio would be far worse without pacification, and no one wants to go back to the time when thugs in board shorts and bandoleers played cop, judge and jury.

If you want to turn a cop into a sociologist, just ask why crime is so high. Still, José Mariano Beltrame is worth listening to. A federal policemen turned public safety commissioner for the state of Rio, he knows that policing the police is one of the big challenges of pacification. To keep Rio's finest in line he installed satellite tracking equipment in patrol cars, security cameras in police stations and applied business-management software to streamline police work.

That's just a start. "Police are the first step," he said on Brazilian television last month. It's no use to send in model elite cops, he said, if public services like schools, health clinics and job training don't follow. "It's going to take a long time to change the paradigm of violence if these [high-crime] areas of Rio are not occupied by the State. That's absolutely necessary."

It's also an agenda for a society on the rise. As Brazilians step up, they can see more clearly -- enough to know what's still missing. "What people are complaining about isn't new," Marcelo Neri, an economist who heads the Brazilian office of strategic affairs, told reporters in Rio not long ago. "Maybe they didn't say anything because they never felt entitled to." That diffidence is gone. The anger on the Brazilian street is the funk of entitlement. Football is grand, but the land that brought the world the beautiful game wants a country to match.

To contact the writer of this article: Mac Margolis at macmargolis@terra.com.br.

To contact the editor responsible for this article: James Gibney at jgibney5@bloomberg.net.