The streets of central Rio de Janeiro and dozens of other cities echoed with percussion grenades and swirled with teargas last night as ranks of riot police scattered the biggest demonstrations Brazil has seen for more than two decades.

As a minority of protesters threw rocks, torched cars and pulled down lamp-posts, the police fired volleys of pepper spray and rubber bullets into the crowd and up onto overpasses where car drivers and bus passengers were stuck in traffic jams. At least 40 people were injured in the city and many more elsewhere.

A vast crowd – estimated by the authorities at 300,000 and more than a million by participants – filled Rio's streets, one of a wave of huge nationwide marches against corruption, police brutality, poor public services and excess spending on the World Cup.

Simultaneous demonstrations were reported in at least 80 cities, with a total turnout that may have been close to 2 million. An estimated 110,000 marched in São Paulo, 80,000 in Manaus, 50,000 in Recife, and 20,000 in Belo Horizonte and Salvador.

Clashes were reported in the Amazon jungle city of Belem, in Porto Alegre in the south, in Campinas north of São Paulo and in the north-eastern city of Salvador.

Thirty-five people were injured in the capital Brasilia, where 30,000 people took to the streets. In São Paulo, one man died when a frustrated car driver rammed into the crowd. Elsewhere countless people, including many journalists, were hit by rubber bullets.

The vast majority of those involved were peaceful. Many wore Guy Fawkes masks, emulating the global Occupy campaign. Others donned red noses – a symbol of a common complaint that people are fed up being treated as clowns.

The protests were sparked last week by opposition to rising bus fares, but they have spread rapidly to encompass a range of grievances, as was evident from the placards. "Stop corruption. Change Brazil"; "Halt evictions"; "Come to the street. It's the only place we don't pay taxes"; "Government failure to understand education will lead to revolution".

"Brazil woke up. The youth are going to the street, the workers as well, to construct a new fight," said Paulo Henrique Lima, 24, one of the organisers. "We are changing the history of this country. We are going to construct a new politics where people have a voice and go to the street to demand this."

The swelling tide of protests prompted President Dilma Rousseff to cancel a trip next week to Japan, her office said. She has called an emergency meeting on Friday morning with key ministers.

A former student radical herself, Rousseff has tried to mollify the protesters by praising their peaceful and democratic spirit. Partly at her prompting, Rio, São Paulo and other cities have reversed the increase in public transport fares, but this has failed to quell the unrest.

"There are no politicians who speak for us," said Jamaime Schmitt, an engineer. "This is not just about bus fares any more. We pay high taxes and we are a rich country, but we can't see this in our schools, hospitals and roads." Many in the mostly young, middle class crowd were experiencing their first large protest.

Matheus Bizarria, who works for the NGO Action Aid, said people had reached the limit of their tolerance about longstanding problems that the Confederations Cup and World Cup have brought into focus because billions of reals have been spent on new stadiums rather than public services. Rio is also due to host a papal visit to World Youth Day next month, and the Olympics in 2016.

"It's totally connected to the mega-events," Bizarria said. "People have had enough, but last year only 100 people marched against a bus price rise. There were 1,000 last week and 100,000 on Monday. Now we hope for a million."

Initially the mood in Rio was peaceful. When a handful of people began tearing down posters for the Confederations Cup, the rest of the crowd sat down around them and shamed them with shouts of "No violence" and "No vandalism".

But later protesters pulled down security cameras, smashed bus stops and torched cars. Every hoarding that advertised the Confederations Cup was destroyed.

Police had increased their manpower more than 10-fold from Monday, and were quickly on the offensive.

After a confrontation near the city hall, they drove back the crowd, who fled coughing with tears streaming down their cheeks. At least one person was hit by rubber bullets, and showed the bruise on the leg where he was hit.

Others were furious that the police actions were indiscriminate. "Where we had been tranquil, then suddenly they started firing gas into the crowd. People were scared and appalled," said Alessandra Sampaio, one of the protesters.

"They are cowards. They wanted to disperse the crowd never mind who it was. I'm very angry, it was a real abuse of power."

Victor Bezerra, a law student, said the police actions were like something from the dictatorship era. "These are bad days for Brazil. The police were acting just like they did 30 years ago."

The crowd were driven into side streets and back towards the central station by lines of police backed by officers on horseback and motorbikes, carrying shotguns.

"Look at this. It's hard to believe. Terrible!", said Ellie Lopes, a 22-year-old passerby, as she surveyed the debris and flames.

After riot police cleared the entire central area, they were still dispersing gatherings in the Lapa music and bar district late into the night. As helicopters buzzed overhead, they fired teargas into the crowded square next to a concert by the band Cannibal Corpse. Hotdog kiosk vendors found themselves with sore running eyes, inadvertently pushed onto a moving frontline.

Despite the crackdown, many said they would return to the streets for the next demonstration, planned for Saturday.

(Additional reporting by Dom Phillips)