Sao Paulo: Brazil’s Workers’ Party lost control of Sao Paulo city hall Sunday in a nationwide municipal polls rout that saw the once dominant leftist force punished by voters angry at recession and corruption.

In an emphatic outcome, the Workers’ Party mayor of Brazil’s biggest city, Fernando Haddad, was trounced by Joao Doria from the centrist PSDB. A second round runoff had been widely predicted but Doria cleared the required 50 per cent barrier with 53 per cent of the vote, meaning he won outright.

The loss of Sao Paulo headlined a dark day for the Workers’ Party, which shaped Brazil for the last 13 years but risks free fall as Brazilians shift to the right ahead of 2018 presidential elections.

“It’s a very hard defeat for the Workers’ Party,” said Michael Mohallem, a politics expert at the Getulio Vargas Foundation. “The question is how hard it would be — and it was very hard.”

The elections for mayors and city governments across 5,568 municipalities in Latin America’s biggest country were the first since Dilma Rousseff of the Workers’ Party lost the presidency in a bruising impeachment battle in August.

They also come as Workers’ Party founder and former president Luiz Inacio Lula da Silva faces corruption charges that could sink his already flagging political career.

In Rio de Janeiro, second in size to Sao Paulo, the result was more mixed.

The first round was won by Marcelo Crivella from the socially conservative Brazilian Republican Party (PRB), considered the political wing of the wealthy evangelical Universal Church of the Kingdom of God.

But Crivella, whose billionaire uncle founded the Universal Church, got only 28 per cent of the vote and will face off on October 30 against Marcelo Freixo from the leftist PSOL, who got 18 per cent.

Brazilians want change as they struggle through a devastating recession and the fallout from a massive embezzlement and bribery scheme centred on the state oil company Petrobras.

“The elections are our chance to change this scenario,” said accounting student Wemerson Guimaraes, 21, as he voted in Rio.

In Sao Paulo, retiree Clara Nunes, 64, said that “with new politicians coming in, the situation could get better.”

Among the earliest to cast a ballot in Sao Paulo, which is also Brazil’s financial powerhouse, was Rousseff’s post-impeachment replacement, President Michel Temer from the centre-right PMDB party.

Temer, who is deeply unpopular and was booed at the opening ceremony of the Rio Olympics in August, abruptly changed his schedule to vote two hours earlier than scheduled — reportedly to dodge protesters.

But despite widespread public mistrust of Temer, voters backed the push of his ruling coalition, including the PMDB and PSDB, to sink the Workers’ Party.

Symbolising how much influence the Workers’ Party has lost, the communist mayoral candidate in Rio de Janeiro, who had been personally supported by Rousseff and Lula, got only three per cent.

Senator Aecio Neves, the PSDB leader who narrowly lost to Rousseff when she was reelected as president in 2014, was in celebratory mood, saying his party had won control over more state capitals than any other party.

The Workers’ Party, which only won one state capital in the first round, was “without doubt the big loser of the elections,” he said.

The army reinforced security in nearly 500 towns and cities across the country following a string of candidate killings.

The latest fatality was Jose Gomes da Rocha, shot dead along with a police officer while campaigning in Itumbiara in the state of Goias on Wednesday.

G1 news site reported Sunday that seven polling stations have been attacked in the northeastern state of Maranhao, including an arson attack that damaged an electronic voting machine.

Shots were also fired at the mayor of Nova Erechim, in southern Brazil, who is not seeking reelection in Sunday’s polls, G1 reported.

In Rio de Janeiro, 15 candidates or politicians have been murdered over the last 10 months, police say. Police numbers are being doubled in the state for the election, with officers guarding the transport of ballot boxes and the voting stations.

Suspicions in at least some of the cases have fallen on so-called militias — protection rackets formed by former or rogue police officers.

O Globo newspaper reported that militias were even forcing candidates to pay an “election tax” to campaign in areas under their control, with fees running from 15,000 to 120,000 reais (Dh16,889 to Dh135,108).