Rio de Janeiro (AFP) - An evangelical mega-church bishop who once branded Catholics demons was elected mayor of Rio de Janeiro, in nationwide municipal elections confirming Brazil's shift to the right.

This was the second round of balloting for city halls in Latin America's biggest country and confirmed the trend seen in October 2 polls which ended in humiliation for the former governing Workers' Party.

In the first round, the Workers' Party lost about two thirds of the mayor's posts it had won in 2012 elections, including Brazil's largest city, Sao Paulo.

The drubbing underlined the decline of a party founded by ex-president Luiz Inacio Lula da Silva and comes after the removal from office of his handpicked successor Dilma Rousseff in an impeachment trial in August.

The biggest winner emerging from the elections has been the center-right PMDB of new President Michel Temer and allied parties, especially the PSDB.

"The Temer government's base came out with a big win," said political scientist Fernando Schuler in Sao Paulo.

Schuler said losses by the Workers' Party in heartland municipalities, including San Bernardo do Campo in Sao Paulo, "reinforced the tendency seen in the first round -- a defeat for the former government's political bloc."

The highlight of Sunday's runoff elections was a battle for Rio's post-Olympics future between socialist Marcelo Freixo and evangelical Marcelo Crivella, from the Brazilian Republican Party (PRB).

Crivella -- a bishop in the giant Universal Church of the Kingdom of God, founded by his billionaire uncle -- won with an easy 59.4 to 40.6 percent, final results showed.

He has promised to bring law and order to Rio, a city beset by high crime. Despite billions of dollars in investments for the Olympic Games this year the city also suffers from ramshackle infrastructure, including a lack of basic sanitation for many in the impoverished favela neighborhoods.

Casting his vote in Copacabana, Crivella said he would dedicate himself "above all to health, education, transport and public safety."

- Evangelicals to the top -

Evangelical politicians are advancing steadily nationwide, helped by disgust over revelations of systemic corruption among leading politicians and executives during the Workers' Party era.

The evangelical message has also taken root among the poor, who earlier would have been expected to vote more along leftist lines. Several high profile cases of evangelical leaders also caught up in corruption allegations have yet to damage the movement.

Crivella himself faces controversy.

He has had to work hard to distance himself from statements he made in a book he wrote in 1999 in which he described Roman Catholics as "demonic" and claimed that Hindus drank their children's blood. The 59-year-old has also described homosexuality as evil and African religions as worshipping "evil spirits."

Freixo, 49, of the Socialism and Freedom Party, was a dramatically different candidate, advocating socially liberal policies. He won strong support among the city's cultural elite and pro-gay activists.

Mauricio Santoro, a political analyst at Rio de Janeiro State University, said Brazilians are rejecting mainstream politicians and that Crivella and Freixo are signs of the polarized times.

"How is it possible that in Rio de Janeiro, a city of joy and openness about sexuality, there will be a mayor who is very conservative, discriminates and opposes Afro-Brazilian religions? The (centrist) alliance that governed the city has broken," he said.

Schuler said center-right forces had made impressive gains and will look to the presidential elections in 2018.

However, those parties face a conundrum: Now they will have to govern just when Brazil is embarking on painful and potentially unpopular economic reforms to escape recession.

"Voters could easily become frustrated," he warned.