Updated

Thousands of demonstrators flooded into a square in Brazil's economic hub, Sao Paulo, on Tuesday for the latest in a historic wave of protests against the shoddy state of public transit, schools and other public services in this booming South American giant.

Sparked earlier this month by a 10-cent hike in bus and subway fares and organized via social media, the nationwide protests are giving voice to growing discontent over the gap between Brazil's high tax burden and the low quality of public infrastructure, echoing similar mobilizations in Turkey, Greece and other parts of the globe where weariness with governments has exploded in the streets.

On Tuesday, thousands of people marched on Sao Paulo's City Hall building, where a small group fought police in an attempt to force their way in. Another protest sprang up in the working class Rio de Janeiro suburb of Sao Goncalo.

After an estimated turnout of 240,000 people in 10 cities Monday, the protests are turning into the most significant in Brazil since the end of the country's 1964-85 military dictatorship, when crowds rallied to demand the return of democracy.

Bruno Barp, a 23-year-old law student at Tuesday's demonstration in Sao Paulo, said he had high hopes for the growing movement.

"The protests are gaining force each day, there is a tremendous energy that cannot be ignored," Barp said as demonstrators poured into the central plaza, which was aflutter with banners and echoing with chanted slogans. "All Brazilians are fed up with the government and the poor services we receive, everyone is ready to fight for a change."

Although demonstrations in recent years generally have tended to attract small numbers of politicized participants, the latest mobilizations have united huge crowds around a central lament: The Brazilian government provides woeful public sector even as the economy is modernizing and growing.

The Brazilian Tax Planning Institute think tank found the country's tax burden in 2011 stood at 36 percent of gross domestic product, ranking it 12th among the 30 countries with the world's highest tax burdens.

Yet public services such as schools are in sorry shape. The Organization for Economic Co-operation and Development found in a 2009 educational survey that literacy and math skills of Brazilian 15-year-olds ranked 53rd out of 65 countries, behind nations such as Bulgaria, Mexico, Turkey, Trinidad and Tobago, and Romania.

Many protesting in Brazil's streets hail from the country's growing middle class, which government figures show has ballooned by some 40 million over the past decade amid a commodities-driven economic boom.

They say they've lost patience with endemic problems such as government corruption and inefficiency. They're also slamming Brazil's government for spending billions of dollars on sports stadiums in advance of hosting next year's World Cup soccer tournament and the 2016 Olympics, while leaving other needs unmet.

The government spent nearly $500 million to renovate Maracana stadium in Rio for the World Cup even though the venue already went through a significant face-lift before the 2007 Pan American Games. City, state and other local governments are spending nearly $12 billion on projects for the Olympics in Rio.

A cyber-attack knocked the government's official World Cup site offline, and the Twitter feed for Brazil's Anonymous hackers group posted links to a host of other government websites whose content had been replaced by a screen calling on citizens to come out to the streets.

Maria do Carmo Freitas, a 41-year-old public servant from Brasilia, said she was excited about the protests even though she hadn't taken part in Monday's march.

"I'm loving it. It's been a long time since we Brazilians decided to leave our comfort zone to tell our leaders that we're not happy about the way things are going," said Freitas. "We pay too much in taxes and we get bad services in exchange, bad hospitals, bad public education, public transportation is terrible."

An organization advocating for lower bus fares initiated the protesting last week, but demonstrations have since ballooned with no centralized leadership. Groups of Brazilians also staged small protests Tuesday in other countries, including Portugal, Spain and Denmark.

Tuesday's march in Sao Paulo started out peacefully but turned nasty outside City Hall when a small group lashed out at police and tried to invade the building.

Different groups of protesters faced off against one another, with one chanting "peace, peace" and trying to form a human cordon to protect the building while another group tried to clamber up metal poles to get inside. At one point, one person tried to seize a metal barrier from another who was trying to use it to smash the building's windows and doors.

Vandalism and violent clashes with police similarly marred the end of Monday's mostly peaceful march in Rio, which left the city's downtown stinking of tear gas. That march attracted some 100,000 people, ending with a small splinter group doing an estimated $1 million in damage to the historic state legislature building. Another mass protest is planned for Rio on Thursday.

The protests have raised questions about the country's readiness to host the coming high-profile events including a papal visit to Rio and rural Sao Paulo next month. Brazil is playing host this week to the Confederations Cup, which is seen as a warm-up for next year's World Cup.

Police and military had spent the past year pacifying hillside slums in Rio to prepare for the events, even as the grievances were apparently growing among the country's middle class.

President Dilma Rousseff, a former leftist guerrilla who was imprisoned and tortured during the dictatorship, hailed the protests, even though her government has been a prime target of demonstrators' frustrations.

"Brazil today woke up stronger," she was quoted as saying in a statement released by her office.

"Those who took to the streets delivered a message to society as a whole and most of all to levels of government," Rousseff said. "The massive size of yesterday's protests proves the energy of our democracy, the force of the voice of the street and the civility of our population."

She didn't propose any concrete answers to protesters' demands. Some cities have lowered bus fares seeking to quell outrage, so far without any apparent effect.

Brazilians have long tolerated pervasive corruption, which is widely seen as the cost of doing business, or simply living in Brazil. But the billions of dollars in public funds being spent on the coming sporting events have many people questioning the government's priorities.

Gilberto Carvalho, Rousseff's general secretary, said the protests reflect the new demands of a richer Brazil.

"The impression is that we have overcome some obstacles, but society wants more," Carvalho said.

The office of the United Nations' High Commissioner for Human rights said it "urged the Brazilian authorities today to exercise restraint in dealing with spreading social protests in the country and called on demonstrators not to resort to violence in pursuit of their demands."

The U.N. body added in its Tuesday release that it "welcomed the statement by Brazilian President Dilma Rousseff that peaceful demonstrations are legitimate."

Human Rights Watch called on the government of Sao Paulo to make good on its promise to investigate the use of force by police against protesters. Images of police attacking protesters during a rally last Thursday helped spark the record turnouts at Monday's demonstrations, which were held in Sao Paulo, Rio, Brasilia, Belo Horizonte, Curitiba, Vitoria, Fortaleza, Recife, Belem and Salvador.

___

Associated Press writers Jenny Barchfield in Rio de Janeiro, Marco Sibaja in Brasilia and Jill Langlois in Sao Paulo contributed to this report.