Updated

Enormous demonstrations have shaken cities across this continent-sized country, and more were expected Tuesday in some of the largest outpourings of frustration in decades over red tape, high prices and shoddy services in a rising economic power.

Mostly peaceful marches in at least eight big cities on Monday drew more than 240,000 people nationwide, Brazilian media said, though demonstrations in the cities of Rio de Janeiro and Belo Horizonte were marred by vandalism and violent clashes with police. Several dozen people were reported injured.

The protests began over a hike in bus prices in the city of Sao Paulo, but were also fed by images of that city's police beating demonstrators and firing rubber bullets last week during a march that drew 5,000 people. In Rio, the violent police crackdown on a small and peaceful crowd Sunday near the iconic Maracana stadium incited many to come out this week for what local news media described as the city's largest protest in a generation.

The vast majority of Rio's protesters were peaceful, but a splinter group attacked the state legislature building, setting a car and other objects ablaze. The newspaper O Globo cited Rio state security officials as saying at least 20 officers and nine protesters were injured there.

Protests also were reported in the cities of Curitiba, Vitoria, Fortaleza, Recife, Belem and Salvador. More actions were being planned on social media sites for Tuesday in Sao Paulo and Brasilia.

Monday's protests came during soccer's Confederations Cup and just one month before a papal visit, a year before the World Cup and three years ahead of the 2016 Olympics in Rio de Janeiro. The unrest is raising security concerns and renewed questions over Brazil's readiness to host the mega-events.

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.

President Dilma Rousseff acknowledged the demonstrations with a brief statement Monday, saying: "Peaceful demonstrations are legitimate and part of democracy. It is natural for young people to demonstrate." Rousseff's popularity dipped for the first time in her presidency recently, largely over sluggish economic growth, rising inflation and security worries. She faces re-election next year.

The United Nations' Office of the High Commissioner for Human Rights called on the Brazilian government to take "all necessary measures to guarantee the right to peaceful assembly and to prevent the disproportionate use of force." In a press conference Tuesday in Geneva, spokesman Rupert Colville also called on demonstrators "not to resort to violence in pursuit of their demands."

Brazilians have long tolerated pervasive corruption, even as about 40 million Brazilians have moved out of poverty and into the middle class over the past decade. Many of them have begun to demand more from their government and are angry that billions of dollars in public funds are being spent to host the World Cup and Olympics while few improvements are made on infrastructure elsewhere.

Maria Claudia Cardoso, accompanied by her 16-year-old son at a march in Sao Paulo, said she had come out to condemn a range of problems.

"We're massacred by the government's taxes, yet when we leave home in the morning to go to work, we don't know if we'll make it home alive because of the violence," she said. "We don't have good schools for our kids. Our hospitals are in awful shape. Corruption is rife. These protests will make history and wake our politicians up to the fact that we're not taking it anymore!"

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

"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."

In Rio, the confrontation between police and a small group of protesters dragged on late into the night despite sporadic rain. As the group moved on to the state legislature building, footage broadcast by the Globo television network showed police firing into the air. At least one demonstrator in Rio was injured after being hit in the leg with a live round allegedly fired by a law enforcement official.

Local news media reported that a high school student in Maceio was shot in the face after a motorist forced his way through the demonstrators' barricade. Protesters were attacking the car when a shot was fired. The extent of the 16-year-old's injuries was not immediately known.

In Sao Paulo, Brazil's economic hub, at least 65,000 protesters gathered at a small, treeless plaza, then broke into three directions in a Carnival-like atmosphere, with drummers beating out samba rhythms as people chanted jingles denouncing corruption. They also railed against the action that sparked the first protests last week: a 10-cent hike in bus and subway fares.

Thousands of protesters in the capital, Brasilia, marched on Congress, while a few dozen scrambled up a ramp to a low-lying roof of the 1960s-era modernist building, clasping hands and raising their arms, the light from below sending their elongated shadows onto the structure. Some windows were broken, but police did not use force to push back the protesters.

A survey by the Datafolha polling agency suggested a large majority of participants at the Sao Paulo protest had no affiliation with any political party and nearly three-quarters were taking part in the protests for the first time.

Many Brazilians were angry about Sao Paulo's first protests last week after windows were broken and buildings spray-painted, and protest leaders have repeatedly warned marchers that damaging property would only hurt their cause.

Police, too, changed tactics. In Sao Paulo, commanders said before the protest they would try to avoid violence, but could resort to force if protesters destroyed property. Yet there was barely any perceptible police presence at the start of Monday's demonstration.

In Belo Horizonte, police estimated about 20,000 people took part in a peaceful protest before a Confederations Cup match between Tahiti and Nigeria. Earlier in the day, demonstrators erected several barricades of burning tires on a nearby highway, disrupting traffic.