Brazil's Senate voted to impeach President Dilma Rousseff early Thursday amid the country's worst economic crisis since the 1930s and with only 85 days to go until the Rio Olympics.
After an all-night marathon session of speeches, lawmakers in Latin America's largest nation voted 55-22 to try Rousseff for allegedly breaking budget laws.
The move will see Vice President Michel Temer becoming acting president during her trial, which could last for up to six months.
The impeachment hinges on allegations Rousseff violated fiscal rules in handling the federal budget. But it's also become a referendum on her presidency amid a deep recession and a corruption scandal involving the state oil company, Petrobras. Rousseff, who is the country's first female president, denies wrongdoing.
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 and tell them not to help a transition to a Temer government because she considers moves to impeach her illegal.
Rousseff, who has been in office since 2011, has seen her popularity crushed by Brazil's recession and a two-year probe into a vast kickback scheme at Petrobras. The 68-year-old was also chairwoman of Petrobras at a time when graft occurred, but she has not been accused of corruption.
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.
Rousseff 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.
"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 who was visiting Brasilia. "The best way forward would be to call for new elections."
This story originally appeared on NBCNews.com