(Adds vote against Temer by first judge)
By Anthony Boadle and Ricardo Brito
BRASILIA, June 8 (Reuters) - After its chief judge urged his peers to consider Brazil's political stability, the country's top electoral court on Thursday excluded testimony of engineering company executives in an illegal campaign funding case against President Michel Temer
The decision by the Supreme Electoral Court suggested it may throw out the case that has threatened to unseat the scandal-hit president. That would clearly be a temporary win for Temer, but analysts say it would still leave him weakened and by no means bring an end to the political crisis roiling Brazil.
A guilty ruling would annul the the 2014 election victory of former President Dilma Rousseff and her then running mate Temer and unseat Temer, though he could appeal and likely remain in office until a final decision, which would take months. That would deepen uncertainty over his austerity agenda aimed at plugging a gaping budget deficit and pulling Brazil out of its worst ever recession.
So far, only one judge has ruled in the trial. Herman Benjamin voted to annul the 2014 Rousseff-Temer ticket for accepting bribes and illegal donations.
But four of the seven justices are expected to vote the other way on Friday morning, including the head of the court, Gilmar Mendes, who said any ruling had to consider the stability of the country and Temer should not be compelled to step down for a minor reason.
Exclusion of the plea-bargain testimony from Odebrecht SA executives strengthened Temer's line of argument that his campaign received no illegal funds.
The executives told prosecutors they funneled millions of dollars into the 2014 Rousseff-Temer campaign in return for government contracts and other kickbacks.
The Temer and Rousseff defense teams requested the Odebrecht testimony be scrapped, holding that it went beyond the scope of the original complaint filed to the court by the Brazilian Social Democracy Party (PSDB) after it lost the 2014 election.
"Temer has the votes to stay in office," said Welber Barral, a Brasilia insider and political consultant who is following the case closely, as is much of the country and its investors.
Barral said the court, known as the TSE, would most probably vote 4-3 to throw out the case. Any of the judges, however, could ask for more time to study the case, which could delay a final ruling for weeks.
Brazil's currency strengthened as investors sensed the court would likely favor Temer, raising the survival chances of his measures to close the budget deficit. Interest rate futures, a gauge of concern over Brazil's future, fell off morning highs on the decision to exclude Odebrecht testimony.
Temer opponents had been counting on a TSE ruling to force him from office. The country is stuck in a political crisis triggered by Brazil's biggest ever graft scandal and last year's impeachment of Rousseff, whose supporters called it a soft coup arranged by Temer and allies to thwart the the scandal probe.
Temer himself is under investigation for allegedly receiving millions in bribes and obstruction of justice, and Brazil's top federal prosecutor is widely expected to formally charge him soon.
Temer, whose government's approval ratings are in the single digits, canceled meetings to follow the court session on television in his presidential office, an aide said. "The president is confident his defense with prevail," spokesman Marcio de Freitas told Reuters.
If Temer is forced from office, lower house Speaker Rodrigo Maia would take over, and Congress would have 30 days to pick a caretaker to lead the country until elections in late 2018.
Temer has refused to resign despite separate bribery allegations made in plea-bargain testimony by executives of the world's largest meatpacker JBS SA.
Even if Temer survives the electoral court case and is charged by prosecutors for corruption, he is unlikely to fall.
For the top court to put him on trial, the charges would have to be authorized by two thirds of the lower chamber of Congress, where his allies are still a majority.
The PSDB party, Temer's main coalition ally, delayed until Monday a meeting on whether to pull its three ministers from his cabinet, which would erode his support in Congress, but not to the point that charges against him would pass the chamber. (Reporting by Ricardo Brito, Maria Carolina Marcello and Anthony Boadle; Editing by Andrew Hay)