Brazil experienced one of its biggest nights of protest in decades on Monday as more than 100,000 people took to the streets nationwide to express their frustration at heavyhanded policing, poor public services and high costs for the World Cup.

The major demonstrations in Rio de Janeiro, São Paulo, Brasilia, Belem, Belo Horizonte, Salvador and elsewhere started peacefully but several led to clashes with police and arson attacks on cars and buses.

The large turnout and geographic spread marked a rapid escalation after smaller protests last week against bus price increases led to complaints that police responded disproportionately with rubber bullets, tear gas and violent beatings.

Coinciding with the start of the Confederations Cup – a World Cup test event – the rallies brought together a wide coalition of people frustrated with the escalating costs and persistently poor quality of public services, lavish investment on international sporting events, low standards of healthcare and wider unease about inequality and corruption.

In Rio images and video posted online showed vast crowds.

Location of the demonstrations in Brazil

While the vast majority of demonstrations were peaceful, several police were injured in clashes at the city's legislative assembly, at least one car was overturned and burned and windows were smashed in the offices of banks and notary offices.

The unrest escalated during the night as a large crowd set several fires outside the legislative assembly, smashed the building's windows and daubed graffiti on the walls proclaiming "Revolution", "Down with Paes, down with Cabral [the mayor and state governor]" and "Hate police". Police inside responded with pepper spray and perhaps more – the Guardian saw one protester passed out and bleeding heavily from a wound in the upper arm.

The causes pursued by the protesters varied widely. "We are here because we hate the government. They do nothing for us," said Oscar José Santos, a 19-year-old who was with a group of hooded youths from the Rocinha favela.

"I'm an architect but I have been unemployed for six months. There must be something wrong with this country," said Nadia al Husin, holding up a banner calling on the government to do more for education.

At a far smaller rally in Brasilia demonstrators broke through police lines to enter the high-security area of the national congress. Several climbed on to the roof.

In Belo Horizonte police clashed with protesters who tried to break through a cordon around a football stadium hosting a Confederations Cup match between Nigeria and Tahiti.

In Port Alegre demonstrators set fire to a bus and in Curitiba protesters attempted to force their way into the office of the state governor. There were also rallies in Belem, Salvador and elsewhere.

In São Paulo, which had seen the fiercest clashes last week and the main allegations of police violence, large crowds gathered once again but initial reports suggested the marches passed peacefully.

Reflecting the importance of social networks in spreading the message about the protests, some in São Paulo – where numbers were estimated at between 30,000 and 100,000 – carried banners declaring "We come from Facebook".

Most protesters were young and for many it was their first experience of such a giant rally. "My generation has never experienced this," said Thiago Firbida, a student. "Since the dictatorship Brazilians never bothered to take over the streets. They did not believe they had a reason to. But now Brazil is once again in crisis, with a constant rise in prices, so people are finally reacting."

Comparisons have been drawn with rallies in Turkey and elsewhere by a more networked society with a long catalogue of grievances. Another global link was the evident in the handful of demonstrators who wore Guy Fawkes masks associated with Anonymous and the Occupy Wall Street protests.

Brazil's demonstrations are being referred to as the "vinegar revolution" (after police arrested people for carrying vinegar to counter tear gas) as well as the "20-cent revolution" (due to the bus price rise) and the Passe Livre (after the demand for free public transport).

Some said the protests felt un-Brazilian but liberating. "Our politicians need to see the strength we have as one people. Brazilians tend to be too nice sometimes, they enjoy partying rather than protesting, but something is changing," said Deli Borsari, a 53-year-old yoga instructor.

Following widespread coverage of the costs of new and refurbished stadiums, the football tournament has been one of the focuses of the protests. Before Saturday's opening match in Brasilia crowds of demonstrators were dispersed by riot police. Footage showed frightened Japanese supporters rushing from the area holding their children as the sound of shots – perhaps rubber bullets or tear gas – was heard.

On Sunday another protest march near Rio's Maracana stadium was met with a similarly heavy police response.

Most of the rallies appeared to start peacefully until they confronted the security forces, who are largely organised at a regional level.

President Dilma Rousseff condones the protests, according to her aides. "The president believes peaceful protests are legitimate and proper for a democracy and that it is natural for young people to demonstrate," said Helena Chagas of the president's office.

However Dilma was booed at the opening ceremony for the Confederations Cup. With the economy in the doldrums and social unrest on the rise she faces a serious political challenge both now and in 2014, when Brazil will not only host the World Cup but also have a presidential election.

Additional reporting by Helena Alves in São Paulo