WHEN he became Brazil’s finance minister a year ago, Joaquim Levy (pictured left) faced an impossible task. He had to close an enormous budget deficit, avert the loss of Brazil’s investment-grade credit rating and reverse the heavy-handed economic interventionism practised by his boss, Dilma Rousseff, during her first term as president from 2011 to 2014. To make matters more difficult, Brazil was entering its worst recession in decades. A vast bribery scandal had already destroyed the credibility of the president’s party, the left-wing Workers’ Party (PT).

Ms Rousseff’s approval ratings have since fallen to single digits and she faces impeachment proceedings for breaking budget-accounting laws. Many finance ministers would have given up long ago. Mr Levy lasted until December 18th, when he resigned and was replaced by the planning minister, Nelson Barbosa (pictured right). 

That change is likely to make a terrible situation worse. It suggests that Mr Levy lost an argument within the government about whether austerity is the right cure for Brazil’s sickly economy, and that he lost it not because his economic remedy was wrong but because it was politically unpalatable. 

Mr Levy and his team “did everything that was asked of us,” he told journalists hours before his resignation was made public. It would be truer to say that he tried valiantly and failed. Dubbed “Scissor Hands” after his first stint as a senior treasury official in 2003-06, he managed to cut discretionary spending in 2015 by a record 70 billion reais ($18 billion). Yet without the co-operation of Congress, which had no interest in helping an unpopular president, he could do little to the nine-tenths of government expenditure that is ring-fenced. On December 16th Fitch became the second credit-rating agency to downgrade Brazil’s debt to junk status.

Mr Levy’s task was made harder by the recession. GDP is expected to have dropped by 3.5% in 2015, dragging down tax receipts. On top of this, the government had to recognise spending promises that it should have booked in 2014. This is forecast to widen the budget deficit to 9.5% of GDP in 2015 from an already elevated 6.5% the year before. Mr Levy argued correctly that only austerity could restrain the growth of Brazil’s debt, restore its credibility with investors, tame inflation and forestall further rises in interest rates. 

Ms Rousseff only half believed him. Her commitment to austerity wavered further as the motion to impeach her (based on her administration’s accounting practices) began to wend its way through Congress in December. To survive, she must rally her left-wing base, which impugns Mr Levy’s policies as heartless “neoliberalism” and calls for more public spending to boost the economy.

That explains her choice of Mr Barbosa. Although he left her first government in 2013 and became a critic of uncontrolled spending—and of the concealment of it—he is seen as more dovish than his predecessor. He was instrumental in formulating a “new economic matrix” of fiscal and monetary stimulus designed to restart growth after the global financial crisis.

Ms Rousseff adopted it during her first term—and took it further than he envisaged.

Mr Barbosa also lobbied for a disastrous budget proposal for 2016 that incorporated a large primary deficit (ie, before interest payments). This triggered a downgrade of Brazil’s credit rating by Standard & Poor’s in September. The proposal was reversed days later at Mr Levy’s urging, but the downgrade stands.

Now that he has Mr Levy’s job, Mr Barbosa promises to persist with his policies. “Our biggest challenge is fiscal,” he averred during a press conference after his appointment. Markets are not so sure. Both the real and the São Paulo stockmarket dipped on news of Mr Levy’s resignation.

Even if Mr Barbosa is sincere, fiscal reforms are unlikely to happen until the impeachment drama plays itself out over the next two months or so. Priorities one, two and three are to defeat the impeachment motion resoundingly, says a PT congressman. Indeed, the motion has acted like a tonic on Ms Rousseff’s demoralised supporters. For the first time in 2015 pro-government demonstrations in mid-December were bigger than those held by its opponents.

Only after the “coup-mongers” are defeated, say the PT’s backers, can the government get back to tackling the fiscal crisis and governing the country, in partnership with a re-energised congressional base.

The question is whether Ms Rousseff would then harness that energy to overcome Brazil’s fiscal problems, or allow herself to be dragged toward greater irresponsibility. The omens are not encouraging. The appointment of Mr Barbosa looks like an attempt to split the difference between Mr Levy’s orthodoxy and the spending demands of her left-wing supporters. It looks no more likely to succeed than the president’s earlier machinations.