A protest in support of striking teachers has turned violent in Rio de Janeiro, as a group of anarchists threw firebombs at public buildings sparking clashes with riot police.

More than 10,000 people marched peacefully through Rio's city centre to back schoolteachers who have been on strike for weeks demanding better wages.

As night fell however, a few dozen anti-establishment "black bloc" anarchists violently hijacked the demonstration.

Their faces covered by scarfs and masks, the rioters smashed a gate of the City Hall, torched a bus and broke into banks, trying to open and set alight cashpoints in Rio's central business district.

Furniture from the banks was flung into the streets and used as barricade against riot police who fired teargas to break up the crowds.

"Without the police, there is no violence. When they are there, there always is," anarchist Hugo Cryois, 23, told the BBC. "You can't trust them".

Teachers have spent 52 days protesting new payroll and benefit packages backed by mayor Eduardo Paes.

Despite the protest Rio councillors approved the package last week. Clashes between demonstrators and police erupted as the vote was ongoing.

A wave of mass protests for social change has engulfed Brazil in recent months.

In June more than one million demonstrators took to the streets to protest against rising prices and corruption. The protesters called for a boycott of the 2014 World Cup, on which they say the government has spent billions of dollars while neglecting social and public services.