(CNN) It's enough to make even the most seasoned political pundit's head spin.
The mess that is Brazil's political situation took a surprising twist when the new chief of the lower house of Congress said Monday that he wanted to strike down impeachment proceedings against President Dilma Rousseff.
The move angered and bewildered many. And by Tuesday morning, interim Chamber of Deputies Speaker Waldir Maranhao had backpedaled, writing a letter announcing he had revoked his decision.
Faced with a Senate vote Wednesday on whether to proceed, the government dispatched Attorney General Eduardo Cardozo to petition the Supreme Court for an annulment, on the basis that the claims are politically motivated.
It's a last-ditch move and the Senate is supposed to vote on the measure as scheduled.
Should the vote pass, Rousseff will have to step down for up to 180 days while the impeachment claims are investigated.
The motion to impeach Rousseff was first initiated in December, and in April the lower house of Congress voted overwhelmingly to begin proceedings.
But with political wrangling at a fever pitch, what will happen next is anyone's guess.
So what exactly is going on?
Corruption allegations have been dogging Rousseff's administration since 2011. A sweeping investigation into a multimillion-dollar kickback scheme at the state-run oil company Petrobras embroiled dozens of the country's leading businessmen and politicians. While she isn't accused directly of profiting, Rousseff was the chairwoman of Petrobras during many of the years of the alleged corruption.
In December, a bid to impeach Rousseff was launched by the then-speaker of the lower house of Congress, Eduardo Cunha, who argued that the President was guilty of breaking budgetary laws by borrowing from state banks to cover a shortfall in the deficit and pay for social programs in the run-up to her 2014 re-election.
She has been also blamed for the worst recession in decades, now in its second year.
"I will fight to survive, not just for my term in office," Rousseff told CNN's Christiane Amanpour last month. "But I will fight, because what I am advocating and defending is the democratic principle that governs political life in Brazil."
Brazil leader defends fiscal practices, says sexism part of effort to oust her
If the vote for an impeachment trial against her goes unimpeded through the Senate, Rousseff would have to step aside for up to six months while she's investigated. She would spend that time preparing her defense. In that case, Brazilian Vice President Michel Temer would temporarily take the reins until November when the process would return to a special Senate committee.
Michel Temer: 5 things to know about Brazil's VP
At that point, Rousseff would have 20 days to present her case. Following that, the committee would vote on a final determination and then present it for a vote in the full Senate.
It will take a two-thirds majority to remove the President from office.
Dilma Rousseff is the President of Brazil, a former revolutionary and resistance member who was jailed and allegedly tortured in the early 1970s. A former minister for mines and energy, she took office in 2010 as Brazil's first female president. She was handpicked by the popular President Luis Inácio Lula da Silva, universally known as Lula, and enjoyed a period of popularity before corruption scandals mired her second term in office.
Lula da Silva is a founding member of Brazil's only socialist political party, Partido dos Trabalhadores, the Workers' Party. He left office with a 90% approval rating but was questioned by police probing corruption allegations in March. He staunchly denies the accusations.
Vice President Michel Temer would assume the presidency for the time that Rousseff would be obliged to step aside if the impeachment process gets that far. Temer's party, the Brazilian Democratic Movement Party, or PMDB, has also been implicated in the corruption scheme and could be further weakened by the ongoing investigation.
Temer: I want to regain the people's trust
An outspoken critic of Rousseff, Eduardo Cunha was the speaker of the Chamber of Deputies and the man who initiated impeachment proceedings. He was removed from his position in early May by the Supreme Court.
He was replaced by Waldir Maranhao, who called for the annulment of the move to impeach Rousseff, then revoked that decision Tuesday, according to state-run Agencia Brasil.
Even before Maranhao changed tacks, his counterpart in the upper house, Renan Calheiros, had dismissed the motion and said that the proceedings would carry on as planned.
Despite the last-minute political wrangling, the Senate vote still is scheduled for Wednesday.
If a simple majority of senators vote that the Senate should take on the impeachment case, Rousseff will step aside, and all eyes will look ahead to November when she will need to defend herself.
Whatever happens, it is unlikely to be an entirely smooth process. Rousseff's supporters have vowed to take to the streets in retaliation, ensuring a long, and potentially messy, battle ahead.
The impeachment of Dilma Rousseff -- what's next?
The country is facing challenges on numerous fronts, from dealing with the Zika virus to the 2016 Olympics, which are due to open in Rio de Janeiro in August. Due to her obligations to step aside during the impeachment process, Rousseff could be sidelined when the Games begin, something she has worked for since the beginning of the bid process.
Opinion: Should we panic about Rio Olympics? Get real
Not only that, the country faces a crippling recession that has left hundreds of thousands unemployed -- close to 10% -- and thousands of businesses closed. It's sent inflation through the roof. The weak Brazilian real, which Olympics organizers are hoping will attract Olympic tourism, spiked briefly on Monday's announcement about the impeachment process before resettling.