Brazil's Supreme Court on Wednesday overturned an injunction that ordered the indicted head of the Senate, Renan Calheiros, to step down, voting to allow him to continue in the post but not in the presidential line of succession.
The 6-3 ruling defuses a clash between the top court and the Senate that threatened to derail austerity legislation at the center of President Michel Temer's plan to bring a widening budget deficit under control and end a two-year recession.
The decision removed uncertainty about the final approval next week in the Senate of a constitutional ceiling on federal spending that investors consider a crucial step for Brazil to regain investment status.
The removal of Calheiros, who was indicted last week on embezzlement charges, would have left the Senate leadership in the hands of a leftist senator whose Workers Party opposes the spending cutbacks at the heart of Temer's efforts to restore fiscal discipline.
Calheiros, whose mandate in charge of the chamber expires when Congress goes into its Christmas recess in a few days, refused to step down on Tuesday, heightening the standoff between the legislature and judiciary.
He was second in line to Brazil's presidency after the speaker of the lower house, as the nation currently has no vice president.
Justice Marco Aurelio de Mello defended his injunction issued on Monday based on a majority vote by the court a month ago that no person indicted for a crime could be in the presidential line of succession.
But in Wednesday's ruling, the majority decided that, while no indicted person can be in line for the presidency of the country, that does not mean they have to step down from other positions.