Outside Congress, where a metal fence was erected to keep apart rival protests, about 6,000 backers of impeachment had earlier chanted "Out with Dilma" while police used pepper spray to disperse gangs of Rousseff supporters, who hurled flares back.
A majority of Brazil's Senate indicated on Thursday it will vote to put President Dilma Rousseff on trial for breaking budget laws, signalling the end of 13 years of rule by the country's leftist Workers Party.
In a marathon session of speeches, 41 of the 81 senators in Latin America's largest nation had indicated by the early hours of Thursday morning that they would vote to try Rousseff, a move that would suspend Brazil's first woman president.
The final vote, expected around dawn, would make Vice President Michel Temer acting president during her trial, which can last for up to six months.
Outside Congress, where a metal fence was erected to keep apart rival protests, about 6,000 backers of impeachment had earlier 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.
Rousseff prepared for defeat by planning her exit from the presidential palace. Aides said she will dismiss her ministers on Thursday morning and tell them not to help a transition to a Temer government because she considers her impeachment illegal.
Temer plans to swear in new ministers on Thursday afternoon, Senator Romero Juca, head of his Brazilian Democratic Movement Party (PMDB), told reporters.
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.
"Today we are trying to overcome this situation by removing an irresponsible government. We have no alternative," said Senator Blairo Maggi, one of Brazil's biggest soy farmers, who is slated to become agriculture minister in a Temer cabinet.
The Supreme Court rebuffed a last-ditch bid by Rousseff to halt the Senate vote with an injunction. Justice Teori Zavascki rejected as "legally implausible" the government's argument that impeachment was flawed because it was begun out of revenge by the former speaker of the lower house.
In a momentous session that many Brazilians followed live on television, each senator was given the chance to speak. A final vote could take place as late as 5:00 a.m. (0800 GMT) on Thursday.
Brasilia-based consultancy ARKO Advice projected that the upper chamber would vote 57-21 to try Rousseff, with three abstentions or absences.
That would indicate Rousseff's opponents may already have the two-thirds of the vote needed to convict her at the end of the trial and remove her definitively from office.
If that happened, Temer would then fulfil the remainder of her mandate until elections in 2018.
Rousseff, 68, was chairwoman of Petrobras when much of the graft occurred, but she has not been accused of corruption.
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.
The president's plan to dismiss all her cabinet if and when the Senate suspends her will force Temer to hit the ground running, since he was counting on a gradual transition to a new cabinet.
Two Rousseff aides said, however, that the dismissal of her cabinet would exclude Central Bank Governor Alexandre Tombini, and the current sports minister, who is scrambling to prepare for the Rio 2016 Olympic Games in August.
'TIME FOR HER TO GO'
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.
"I voted for Dilma, I believe in her as a leader, but I also think she has done such a bad job that it is time for her to go," said Leticia Britto, a 23-year-old business student from Sao Paulo, visiting Brasilia. "The best way forward would be to call for new elections."
Leaning toward a liberal economic policy, Temer has picked former central bank chief Henrique Meirelles to be finance minister and Itau Unibanco's chief economist Ilan Goldfajn as head of the central bank.
"Temer may enjoy a honeymoon with markets for some weeks, maybe months, but when investors come to realise that the fiscal results will not improve fast enough, then we could see some disappointment later this year," said Bruno Lavieri, an economist with consultancy 4E, in Sao Paulo.
Rousseff has denied committing any crime that warrants impeachment charges. 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 on Tuesday, to cheers from supporters.
Rousseff's stance that democracy is under attack has won sympathy among some of Brazil's leftist neighbours. The U.S. government, meanwhile, said it hoped the country pulls through the crisis.
"Brazil is under some scrutiny and under some pressure," White House spokesman Josh Earnest said in Washington. "We continue to have confidence in the mature, durable democratic institutions in Brazil to withstand the challenge."
The last time a Brazilian president was suspended from office was in 1992, when Fernando Collor de Mello was placed on trial for corruption. He resigned from office shortly before he was found guilty by the Senate.