(Bloomberg) -- Brazilian senators reelected an ally of President Luiz Inacio Lula da Silva as head of the upper house of Congress, one of country’s most powerful political positions, in a defeat to former President Jair Bolsonaro who was backing another candidate. 

Rodrigo Pacheco on Wednesday beat Bolsonaro’s former minister and current Senator Rogerio Marinho by 49-32 votes. He will lead Brazil’s Senate for another two years, also acting as president of Congress in Brasilia.

The result is an early political victory for Lula, who backed Pacheco in an attempt to influence the upper house, which leans right after a strong showing by Bolsonaro’s allies in October’s elections. The left-wing president has already made several nods to lawmakers, whose support he needs to pass key legislation including an overhaul to the tax system and a new fiscal anchor.

The race for the leadership of the Senate turned into a re-run of last year’s presidential vote, with both Lula and Bolsonaro pushing for their candidates to capture a key job to influence legislation.

“Brazil needs peace, the toxic polarization amid two political sides has to be eradicated,” Pacheco said after his election in the Brazilian capital, vowing to stay away from the influence of the executive power. “We will have to establish the due independence.”

Pacheco, 46, remained mostly neutral during Bolsonaro’s administration, which ended on Dec. 31 after his narrow defeat to Lula. As the former president escalated his fight with the Supreme Court, Pacheco barred requests to impeach justices and began to distance himself from the right-wing leader, even rehearsing his own bid for the presidency, which was quickly abandoned.

Behind the scenes, Pacheco backed Lula during the presidential campaign — support that’s now being reciprocated. Although Lula has vowed to not interfere in congress elections, five of his cabinet members returned to their posts as elected senators to vote for Pacheco — a common procedure when the government needs votes in congress.

Separately, the lower house reelected Speaker Arthur Lira to another term with 464 of 513 votes. 

Lira, 53, was a key ally of Bolsonaro’s during his years in office, but quickly moved to formally recognize the result of the election and work with Lula and his allies to pass legislation to allow for higher social payments to continue into 2023.

--With assistance from Simone Iglesias.

©2023 Bloomberg L.P.