The Brazilian Senate has voted in favour of putting President Dilma Rousseff on trial for breaking budget laws by 55 votes to 22, signalling the end of 13 years of rule by the country's leftist Workers Party. The final vote would make Vice President Michel Temer acting president during her trial, which could last for up to six months. The Senate action came after the lower house voted 367-137 last month in favour of impeachment.

Brazil Dilma impeachment
Brazil's President Dilma Rousseff, accompanied by Chief Of Staff Jaques Wagner, looks from a window at Planalto Palace in Brasilia, as demonstrations go on outside Adriano Machado/Reuters

Outside Congress a metal fence was erected to keep apart rival protests. About 6,000 backers of impeachment chanted "Out with Dilma", while police used pepper spray to disperse gangs of Rousseff supporters, who hurled flares back. One person was arrested for inciting violence.

Her critics argue she has caused deep damage to Latin America's largest nation, while supporters call the move to impeach her a coup d'etat.

In a momentous session that many Brazilians followed live on television, each senator was given the chance to speak. Brasilia-based consultancy ARKO Advice projected that the upper chamber would vote 57-21 to try Rousseff, with three abstentions or absences.

Under the rules of the impeachment process, each senator was allowed up to 15 minutes to speak, and many made full use of their moment in the spotlight. AP reports that more than 16 hours into the debate, the 50th senator was giving his speech, leaving 21 colleagues still scheduled to talk. Older senators had gone off for naps and were having their aides call when their time to speak was about to come.

Rousseff, who has been in office since 2011, has seen her popularity crushed by Brazil's worst recession since the 1930s and a two-year probe into a vast kickback scheme at state-run oil company Petrobras. The prospect of business-friendly Temer taking power has driven Brazilian financial markets sharply higher this year, on hopes he could cut a massive fiscal deficit, restore investor confidence and return the economy to growth. The political crisis has deepened Brazil's recession and comes at a time when Brazil hoped to be shining on the world stage as it prepares to host the Olympic Games in Rio de Janeiro in August.

Opposition senators blamed Rousseff for running into the ground an economy now considered the worst performing among major developing nations, pursuing what they called populist policies that led to high inflation, recession and unemployment.

Rousseff, 68, was chairwoman of Petrobras when much of the alleged mismanagement occurred, but she has not been accused of corruption. Instead, she stands charged with manipulating government accounts to disguise the size of Brazil's fiscal deficit to allow her to boost public spending during her 2014 re-election campaign, a practice also employed by previous presidents.

Opinion polls show an overwhelming majority of Brazilians want to see Rousseff impeached. But the surveys also indicate scant popular support for the 75-year-old Temer.

Rousseff has vehemently denied her administration's financial sleight of hand moves constituted a crime and argued that such manoeuvres were used by prior presidents without repercussions. She has stressed that, unlike many of those who have pushed for impeachment, she does not face any allegations of personal corruption.

Brazil Dilma impeachment
Embattled Brazilian President Dilma Rousseff waves as she arrives to speak at a women's rights conference in Brasilia on 10 May 2016 Mario Tama/Getty Images

A former member of a Marxist guerrilla group who was tortured during Brazil's 1964-1985 military dictatorship, she has called her impeachment a coup and vowed to fight the process until the last minute. "I will not resign, that never crossed my mind," Rousseff said in a speech, to cheers from supporters.