A majority of members of Brazil's Senate had indicated by last night that they 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 that they would vote to try Rousseff, a move that would suspend Brazil's first woman president.
The final vote, expected around dawn local time and late last night NZT, would make Vice-President Michel Temer acting president during her trial, which could last six months.
Outside Congress, where a metal fence was put up to keep apart rival protests, about 6000 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 was to dismiss her ministers and tell them not to help a transition to a Temer government because she considers her impeachment illegal.
Temer planned to swear in new ministers today, 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 the country 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.
Brasilia-based consultancy ARKO Advice projected that the upper chamber would vote 57-21 to try Rousseff, with three abstentions or absences.
That indicated that Rousseff's opponents had the two-thirds of the vote needed to convict her at the end of the trial and remove her definitively from office.
If that happens, 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 blame game
• The impeachment measure was based on allegations that Dilma Rousseff, Brazil's first female president, broke fiscal laws.
• The process morphed into something of a referendum on Rousseff and her handling of the country over the past six years.
• Brazil is mired in the worst economic downturn in decades and a sprawling corruption scandal.
• Supporters of impeachment blame Rousseff and her Workers Party for the stalled economy and insist that Vice-President Michel Temer, whose party has split from the governing coalition, represents the only hope of reviving it.