Brazilians have been on the streets protesting after the Senate approved a 20-year freeze on government spending that a UN official described as a "historic mistake".
The upper house voted 53 to 16 on Tuesday to lock in the spending ceiling.
Centre-right President Michel Temer says tough measures are needed to get Brazil's finances back under control, but his austerity policies have drawn sharp criticism and prompted violent protests.
Opponents say the austerity measures, which will affect spending on health, education and social programmes, are an attack on the poor in a country where wealth distribution is already among the worst in the world.
Police were out in force in the capital, Brasilia, to protect government buildings from demonstrators during the upper house vote.
However, hundreds of people, many with their faces covered, clashed with police later on Tuesday. Security forces fired tear gas to try to disperse the crowd.
A bus was burned during the demonstration, which drew about 2,000 people, police said. The police operation in the capital ended with 100 arrests, officials said.
OPINION: The fight for Brazil's future
In Sao Paulo, left-wing protesters attacked the headquarters of FIESP, the country's main industrial association, before being driven back.
The vote means that the spending cap is now mandated by the constitution, serving as the central plank in Temer's effort to "transform" the broken economy, which is in deep recession.
Philip Alston, the UN poverty and human rights rapporteur, attacked the 20-year spending cap as "putting an entire generation at risk of social protection standards well below those currently in place".
"This is a radical measure, lacking in all nuance and compassion," he said last week. "It will hit the poorest and most vulnerable Brazilians the hardest."
Brazilians, battered by nearly 12 percent unemployment and stubbornly high inflation, are increasingly angry over corruption scandals and largely hostile to the austerity measures.
A poll published on Tuesday showed that 60 percent of Brazilians oppose the spending ceiling. Only 24 percent were in favour, according to the Datafolha poll.
Source: News agencies