"Shame, shame," chanted the crowd as police reinforcements arrived. First a water cannon truck, then about 20 riot police on horseback.
More than 2,000 people, ranging from teachers to off duty police officers, faced off against elite Shock Battalion police outside the state legislature in the center of Rio.
They blew whistles and chanted calls for the resignation of Rio state Governor Luiz Fernando Pezao who is pushing budget cuts in response to nearly empty public coffers.
"Public servants won't pay for the crisis!" read banners.
A handful of protesters threw stones at the ranks of police who were protected by shields, while others brandishing red and blue smoke flares taunted the officers.
Police stood behind two metal barriers protecting the steps of the legislature but retreated when a group of demonstrators managed to break down the first fence.
The skirmish triggered more than an hour of unsuccessful attempts by police to disperse the growing number of protesters in the avenue outside.
Officers fired dozens of stun grenades and tear gas canisters at the generally peaceful demonstration, on occasion aiming horizontally into the crowd.
"That went right past my head!" shouted one man as he fled along with hundreds of other people from the clouds of tear gas swirling down the palm-lined street in the business district.
"Shame, shame," chanted the crowd as police reinforcements arrived -- first a water cannon truck, then about 20 riot police on horseback.
The water cannon was also brought into action, prompting chants of "cowards!"
Each time the police firepower died down, however, the crowd reconverged on the legislature.
AFP reporters saw at least three people injured, including one who appeared to be unconscious and was receiving CPR treatment. An AFP video journalist suffered light injuries in a leg after a stun grenade explosion.
Among the austerity measures under examination is an increase in the 11 percent withholdings from public servants' pensions to 14 percent. An increase of as much as 30 percent has previously been considered.
The state government, which has barely enough money to pay many public employees or keep hospitals functioning, could also raise transport and utilities costs, as well as cutting subsidies for the poor. The state has been in crisis all year and required a huge federal bailout just before hosting the Olympic Games in August.
The irony of government employees clashing with police who are also struggling to get their full salaries and even basic funding for police stations was not lost on demonstrators.
"It's police attacking police," said one off-duty officer in disbelief as he retreated from another tear gas attack.
"There aren't any criminals here, only policemen, firefighters, teachers, working class people, fathers of households -- people who have bills to pay," said first responder Francisco Gabriel Cordoba.
Brazilian media reported that two riot police officers left their posts and joined the demonstrators, prompting cheers.