BRASILIA (Reuters) - A shift to the right in Brazil's municipal elections should help President Michel Temer's government enact unpopular legislation to curb public spending and avert a budgetary crisis after 13 years of profligate leftist governments.
Temer's main coalition ally, the right-leaning Brazilian Social Democracy Party (PSDB), emerged as the winner from Sunday's voting. Its resurgence was symbolized by media businessman Joao Doria's mayoral election victory in Sao Paulo.
A political outsider who is an outspoken advocate of privatisations and fiscal belt tightening, Doria wrested control of Brazil's largest city from the leftist Workers Party as voters punished its involvement in a corruption scandal.
Combined with a solid national performance by Temer's own Brazilian Democratic Movement Party (PMDB), the government emerged in a stronger position to overcome resistance in Congress and on the streets of Brazil from the left-leaning opposition, politicians and analysts said.
Temer's flagship reform, a constitutional amendment that would cap public spending in line with inflation for 20 years, will face the first of four votes in Congress early next week, where the Workers Party has vowed to block the measure.
Sunday's vote handed a heavy defeat to the Workers Party, which lost more than half its mayors, leaving it in a far weaker position for organising popular protests and campaigning for future legislative elections.
Many voters expressed anger at the leftist party for leading Brazil into its worst recession since the 1930s and for its leading role in the country's biggest corruption scandal, centred on state oil company Petrobras.
"The PT reaped what it sowed," said lawmaker Rubens Bueno, leader of the Popular Socialist Party (PPS) in the lower chamber. "Voters said they want an organised country without corruption and bad government. They want fiscal discipline."
The PSDB, by contrast, hailed the election result as an endorsement of its platform for leaner government, the privatisation of state enterprises and transparent, better-managed public accounts.
"The country is demanding fiscal austerity, exemplary political conduct and managerial skills in government," said Senator Paulo Bauer, the PSDB leader in the upper chamber.
He said his party will fully back the reforms proposed by Temer and oppose any attempts to water them down.
Temer is staking his political reputation on getting the constitutional amendment through Congress this year, before turning a broader agenda of reforms in 2017.
His government has pledged to overhaul Brazil's overburdened pension system, the main cause of a deficit that ballooned to 10 percent of GDP last year, and Temer wants to introduce a minimum retirement age.
Debate has also started on vital political reforms to reduce the proliferation of parties - 28 in Congress and 35 registered in the country - that makes Brazil so hard to govern. The fragmentation has been blamed for fostering corruption by necessitating broad coalition and deal making in Congress.
Reform of outdated labour laws that make Brazil less competitive is perhaps the toughest challenge facing Temer. It is certain to encounter stern resistance from leftist parties, labour unions, and even sectors of his PMDB, a geographically and politically diverse party.
Although Temer governed as interim president since May, he only officially took over from president Dilma Rousseff in August when she was dismissed by the Senate for breaking budget laws.
With his term expiring at the next presidential election in 2018, Temer has little time to fix Brazil's problems. He has said he wants to put South America's biggest nation back on track before leaving office, and has pledged not to seek reelection.
"There has been an important shift in the balance of forces among the parties that will add to the pressure for reforms, and that will help Temer," said political scientist Bolivar Lamounier.
Congress, elected in 2014, still has many lawmakers who will resist the reforms, Lamounier said.
But Doria's victory in Sao Paulo was an indication that Brazil's political climate may be shifting fast.
"Doria's election shows how far things have changed in Brazil and how quickly those changes have reached the electorate," said Brasilia political analyst Thiago de Aragao.
Reporting by Anthony Boadle; editing by Grant McCool