BRASILIA Brazilian President Dilma Rousseff took her battle to survive impeachment to the Supreme Court on Tuesday, in a last-ditch attempt to stay in office a day before the Senate will likely vote to try her for breaking budget laws.

Attorney General Eduardo Cardozo, the government's top lawyer, asked the Supreme Court to annul impeachment proceedings arguing they were politically motivated and had no legal basis.

"I will not resign, that never crossed my mind," Rousseff said in a speech to a conference hall full of women supporters who cheered when she vowed to keep fighting her removal.

But the leftist leader appeared resigned to leave the presidency after a Senate vote on Wednesday that is expected to suspend her, pending trial. In her office in the modernistic Planalto presidential palace, aides had packed her papers and cleared the shelves.

The political crisis has hit at a time when Brazil had planned to be shining on the world stage, as it prepares to host the Olympic Games in Rio de Janeiro in August.

Earlier in the day, the acting speaker of the lower house of Congress, Waldir Maranhao, withdrew his controversial decision to annul last month's impeachment vote in the chamber. That meant Cardozo's appeal to the top court may be the president's best hope of stopping the process from moving forward.

If a simple majority agrees to put her on trial, Rousseff will be suspended from office on Thursday, leaving Vice President Michel Temer in power for up to six months during her trial. If Rousseff were convicted and removed definitively, Temer would stay in the post until elections in 2018.

With the prospect looming of an end to 13 years of rule by Rousseff's leftist Workers Party (PT), anti-impeachment protesters blocked roads with burning tires in Sao Paulo, the capital Brasilia and other cities, snarling morning traffic.

The PT and labour unions have called for a national strike to resist what they call a "coup" against democracy.

The legality of Rousseff's imminent removal from office was questioned by the secretary general of the Organization of American States, Luis Almagro, who said he would seek the legal opinion of the Inter-American Human Rights Court.

Maranhao's surprise decision on Monday threw Brazilian markets into disarray and threatened to drag out a painful political crisis with a constitutional standoff that could have ended up at the Supreme Court.

Brazil's currency, the real, strengthened 1.6 percent and the benchmark Bovespa stock index .BVSP closed 3.8 percent higher, reflecting investor hopes that a more market-friendly government will soon take over the recession-hit country under Temer, who is forming a cabinet with pro-business figures.

Temer aides said on Tuesday that he will stick to plans to cut the number of government ministries to 22 from 32 to show his commitment to plugging a widening fiscal deficit that cost Brazil's its prized investment-grade credit rating.

POSSIBLE THURSDAY HANDOVER

Senate President Renan Calheiros, a leader of Temer's PMDB party, disregarded Maranhao's decision on Monday and said the Senate would press ahead with Wednesday's vote. It is expected to take place at about 8 p.m. (2300 GMT) after an all-day session of speeches.

Rousseff's opponents have more than the 41 votes needed to launch her trial in the upper chamber, and they are confident they can muster two-thirds of the 81 senators, or 54, to unseat the unpopular president at the end of a trial.

If she loses Wednesday's vote, Rousseff will be served notice by the Senate on Thursday, at which point the suspended president must vacate the presidential palace. She can continue to live in the presidential residence during the trial.

Temer would step in as interim president as soon as she is given notice.

The impeachment process comes as Brazil is mired in its worst recession since the 1930s and shaken by the country's biggest-ever corruption scandal, which have paralyzed Rousseff's second term in office.

The impeachment process is unfolding as investigators pursue a separate, long-running probe into a vast kickback scheme at state-run oil company Petrobras (PETR4.SA).

"Operation Carwash", which was named for its beginnings as a money-laundering probe, has ensnared dozens of top politicians and jailed chief executives from Brazil's biggest construction firms for paying billions in bribes for bloated contracts.