By Alonso Soto and Maria Carolina Marcello
BRASILIA (Reuters) - Brazil's lower house of Congress elected an ally of interim President Michel Temer as its new speaker late on Wednesday, marking a victory for a government racing to approve unpopular economic reforms.
Rodrigo Maia of the right-leaning Democrats party, known as DEM, won the second round ballot by a wide margin in a hotly contested election.
Maia, a trained economist who worked briefly in banking before turning to politics, signaled he would help Temer move ahead with reforms to pull the economy out of what could be its worst recession in a century.
"I will talk to Temer, who enjoys the support of my party. We are convinced that this government will overcome this crisis and the lower house will help in that task," Maia told reporters after the vote.
The election to replace former speaker Eduardo Cunha, who quit last week as he faces expulsion over ethics violations, had more than a dozen candidates from widely diverse parties.
Maia initially flirted with opposition parties, but was officially backed by other Temer partners such as the Brazilian Social Democracy Party, or PSDB, one of the country's largest. He won 285 votes versus 170 for his rival Rogerio Rosso.
Cunha, who is the target of several graft investigations involving state oil company Petrobras, was a powerful speaker who used his influence to push for the suspension of President Dilma Rousseff in May on charges of doctoring public accounts.
Rousseff was replaced by Temer, her vice president, pending an impeachment trial in the Senate in which senators are expected to vote for her permanent removal.
The new speaker will be crucial to the government's efforts to cap public spending and open up the economy.
"For Temer, this election is extremely important because the speaker sets the agenda and the pace of the lower house," said Humberto Dantas, a political scientist and partner with the E4 consultancy in Sao Paulo.
To the relief of Temer, the candidate from his own Brazilian Democratic Movement Party, Marcelo Castro, was defeated in vote and finished third.
The surprise candidacy of Castro, who was a minister under Rousseff and voted against her impeachment, had raised concerns in the government that if elected he could give the opposition more sway, a presidential aide said, requesting anonymity to speak freely.
(Reporting by Alonso Soto; Editing by Jonathan Oatis, Andrew Hay and Joseph Radford)