More than one million people have taken part in protests in about 100 cities across Brazil, the latest in a wave of anti-government rallies.

Violence erupted in many places and an 18-year-old man died when a car drove through a barricade in Sao Paulo state.

President Dilma Rousseff has called off a trip to Japan to deal with the crisis and is to hold an emergency cabinet meeting.

In Rio de Janeiro, an estimated 300,000 demonstrators poured into the seaside city's central area for a "Tropical Spring" rally.

There were running clashes between riot police and groups of protesters in a number of areas.

Peaceful protesters were also caught up in the violence as police fired tear gas canisters into the crowd and at times indiscriminately used pepper spray.

At least 40 people were injured.

Police in the capital Brasilia struggled to keep hundreds of protesters from invading the Foreign Ministry, while the crowd set a small fire outside.

Other government buildings were attacked around the city's central esplanade.

Police used tear gas and rubber bullets trying to scatter demonstrators.

Clashes were also reported in the Amazon jungle city of Belem, Porto Alegre in the south, the university town Campinas north of Sao Paulo and the northeastern city of Salvador.

The protests began over plans to increase public transport fares that set off demonstrations, which grew into nationwide protests against poor public services, inflation and corruption.

Ms Rousseff has dispatched federal troops to five cities hosting games during the Confederations Cup, an international football tournament that began earlier this month.

The competition is a warm-up for the 2014 World Cup.

The unrest also comes one month before Pope Francis is scheduled to visit Brazil, raising concerns about how Brazilian officials will provide security.

On Wednesday, officials in Sao Paulo and Rio agreed to revoke the public transport fare increases.