A month Brazil hoped would showcase its ability to play on the world stage has turned into days of massive protests highlighting long-standing problems simmering below the surface of the Brazilian success story.

Instead of abating after reversal of a bus fare increase, the catalyst for the protests, the demonstrations have grown in intensity, spreading to 100 cities and towns.

Brazilian President Dilma Rousseff called an emergency meeting with Cabinet ministers on Friday after a night when as many as 1mn Brazilians took to the streets to protest against corruption, inadequate healthcare and education and high crime rates. Some also turned their wrath on expenditures and cost overruns on new soccer stadiums for the Confederations Cup, which runs through the end of the month, and the 2014 World Cup, also to be held in Brazil.

In an address transmitted on Brazilian television and radio on Friday night, Rousseff asked for understanding about “the political and economic limitations” the country is facing and beseeched Brazilians not “to put at risk all that we’ve achieved. We have much to lose”.

But she pledged to create “a grand pact” to improve public services and said among her priorities would be to devote 100% of petroleum revenue to education, send thousands of doctors to rural areas, come up with a national urban transit plan and meet with peaceful protest leaders.

Things turned ugly late Thursday and Friday as police tried to quell protesters with rubber bullets, tear gas and pepper spray. Two deaths have been attributed to the protests.

“I’m here because of the money that is robbed from us. A congressman gets a stipend for travel, clothes and transportation while a favela (shantytown) resident earns 600 reals (about $260 a month),” said Ingrid Munique, 18. She joined the demonstrations in Rio de Janeiro with dozens of her neighbours from the Complexo Alemao favela, who chanted: “I’ll give up the World Cup. I want money for health and education.”

The individual reasons so many Brazilians have taken to the streets may vary, but they represent a generalised discontent and a fear that hard-earned economic gains are in jeopardy, say analysts. The World Cup and 2016 Olympic Games, which will be held in Rio, have become convenient targets in the face of what many protestors view as inadequate public spending on transportation, hospitals and education.

“The Brazilian people are not against the World Cup, but they are against the exorbitant expenditures on stadiums,” said Edgar Reinoso, 61, as he coughed on tear gas during the Thursday night protest in Rio. “For Brazilians to come to the streets this way, it means a lot is wrong - mainly, corruption.”

Riding a commodities boom in recent years, the Brazilian economy became a high-growth darling. Since 2003, some 40mn Brazilians have moved into the middle class. The rich have demonstrated their acquisitive power by snapping up luxury condos in Miami, and even the middle class had begun to enjoy shopping trips to Florida.

But the Brazilian juggernaut has begun to sputter. Last year, the economic grew a mere .9%, and although Brazil is near full employment, economic growth has remained stalled and inflation is rising.

“I think what you’re seeing in Brazil is a rising middle class whose position is somewhat tenuous but that wants to continue on an upward trajectory and don’t see how that’s going to happen,” said Barbara Kotschwar, a research fellow at the Peterson Institute for International Economics. She was in Brazil last week.

Many of the protesters are young, often university students, or are new members of the middle class or lower middle class.

“Those 40mn who have entered the middle class have seen the promised land and they have liked it very much,” said Paulo Sotero, director of the Brazil Institute at the Wilson Center in Washington, DC. “The agenda of the protesters is a middle-class agenda.”

While Brazil’s economic progress has been real, Brazilians are increasingly struck by the persistence of the problems of underdevelopment, Sotero said from Sao Paulo, where he is visiting.

“All this boasting about Brazil and its being the world’s sixth-largest economy and people say, ‘OK, why am I wasting four hours of my life commuting on these terrible buses? And then they want to raise the fare.’ ”

Although Brazil has been lauded for its Bolsa Familia programme, which offers cash payments to families who keep their children in school, the schools the children attend are often sub-par. In the World Economic Forum’s most recent Global Competitiveness Index, Brazil ranked 108 out of 144 countries for quality of education.

“Now society is saying we have been paying attention. We’re not just these happy soccer lovers,” said Sotero. “I think the politicians are absolutely perplexed by this and what their response should be.”

The protests come at a time when Rousseff’s popularity is declining. A poll conducted by Datafolha in early June showed an eight-point decline in her approval rating from 65% to 57%. It was the largest monthly decline in her popularity since she took in January 2011, although in the early months of her presidency her approval rating was as low as 47%.

Some analysts say if the economy continues to decline, Rousseff could be vulnerable in the October 2014 presidential race.

“Brazilians are waiting for the political class to come up with a response that will satisfy their concerns or for new leaders to emerge,” said Kotschwar. “The government is in a tough position.”

Before Friday’s address, Rousseff had remained largely silent on the protests.

Among the ironies of protesters’ rallying cry against corruption, which is endemic in Brazilian politics, is that Rousseff has done more to counter corruption than any president in recent memory, sacking a steady stream of senior officials involved in scandals, fraud and influence peddling.

And there’s another irony. The Confederations Cup, which began on June 15, was supposed to serve as a tuneup for the World Cup to show FIFA, the international soccer federation, and the world that Brazil was ready for a star turn. Instead, the world is getting images of police shooting rubber bullets, shattered windows at ministries in Brasilia, looted stores and bleeding young people.

The lesson may be “it’s really important to keep an eye on what’s happening at home while you try to improve your international image”, Kotschwar said.

For Sotero, what’s happening in Brazil goes far beyond image. “This has altered the political landscape here,” he said. “My hope is that Brazil will benefit from it.”