As most demonstrators headed home in Rio de Janeiro and Sao Paulo, hundreds of masked members of the so-called Black Bloc anarchist group started hurling gasoline bombs, rocks, bottles and pieces of wood at police who had accompanied the protest marches. Police used tear gas and percussion grenades to disperse the violent activists.
"I can't believe this is my Brazil, my city," screamed one man, eyes teared up from floating gas. "This isn't democracy." He did not want to give his name.
In Rio, police said about 4,000 demonstrators gathered in the city center to mark National Teachers Day and show their support for public school teachers who have been on strike for more than two months seeking higher pay.
Similar scenes of violence played out in Sao Paulo, where Black Bloc activists also attacked police, bringing an early end to a march by several hundred demonstrators toward the governor's palace.
Earlier, activists of the "Roofless" movement tried to invade the Sao Paulo city council building, but were pushed back by police. They later regrouped in front of city hall in a peaceful rally that lasted about two hours.
Last week, a largely peaceful rally by some 20,000 demonstrators turned violent in Rio when small groups of masked protesters started hurling rocks and fire bombs at banks, stores and restaurants and set fire to a passenger bus.