Fighting to save his job, Brazilian President Michel Temer has received a huge boost from a decision by the country's top electoral court to reject allegations of illegal campaign finance and keep him in office.

The Superior Electoral Tribunal's 4-3 vote late Friday gave Temer a lifeline amid widespread calls that he resign in the face of a corruption scandal.

Last month, a recording emerged that apparently captured Temer endorsing hush money to ex-House Speaker Eduardo Cunha, a former Temer ally serving 15 years in prison for corruption and money laundering. Soon after, details of another bombshell emerged: that Temer was being investigated for taking bribes.

Temer has denied wrongdoing and vowed to stay in office.

However, the fallout from the scandals was so great that many observers expected that the electoral court judges would be swayed to remove Temer from office over unrelated campaign finance allegations. While in theory Brazilian justices are impartial, in reality they are often highly political. Indeed, two of judges who voted in Temer's favor were his appointees.

"While Temer is hard for many people to digest, he will likely remain in office," said Alexandre Barros, a political risk consultant with the Brasilia-based firm Early Warning. "Instability is bad for everybody. So many will say at this point, 'If we have to pay the price for sticking with Temer, let's do it.'"

While Temer has crossed a huge hurdle to staying in power, he is still facing threats on many fronts. The attorney general is considering pressing charges against him for allegedly receiving bribes, over the audio recording and for allegedly trying to obstruct a colossal investigation into billions of dollars in inflated contracts and kickbacks to politicians. Temer's approval rating is hovering around 9 percent and he has a tenuous hold on his ruling coalition.

Disclaimer: Nothing posted on this blog is intended, nor should be construed, as legal advice. Blog postings and hosted comments are available for general educational purposes only and should not be used to assess a specific legal situation. Nothing submitted as a comment is confidential. Nor does any comment on a blog post create an attorney-client relationship. The presence of hyperlinks to other third-party websites does not imply that the firm endorses those websites.