PLENTY of countries run deficits. And when recessions occur, loosening the public purse strings makes sense for many of them. But Brazil is not most countries. Its economy is in deep trouble and its fiscal credibility is crumbling fast. The end of the global commodity boom and a confidence-sapping corruption scandal, after years of economic mismanagement, have extinguished growth. Brazil’s GDP is expected to contract by 2.3% this year. Fast-rising joblessness, together with falling real private-sector pay and weak consumption, are squeezing tax receipts. Meanwhile rising inflation, allied to a free-falling currency, means investors demand higher returns on government debt. The result is a budgetary disaster. This year a planned primary surplus (ie, before interest payments) has vanished. Once interest payments are included, the total deficit this year is projected to be 8-9% of GDP.

Faced with the prospect of public finances slipping out of control, Brazil’s policymakers have stuck their heads in the sand. The 2016 draft budget sent to Congress this week by the president, Dilma Rousseff, builds in a primary deficit for the first time in the post-hyperinflation era (see article). The very legality of a budget with a primary deficit has been questioned: a fiscal-responsibility law passed in 2000 has long been interpreted as banning spending that outstrips receipts. But whatever the legal debate, the budget is calamitous.

First, Brazil would have to borrow to cover all its interest payments—a risk for a country with by far the highest real interest rates of any sizeable economy, at a time of recession and wider emerging-market jitters. Second, a primary deficit sends a bleak message about Brazilian economic management. Since the turn of the century Brazil’s government has been guided by three principles: a credible inflation target, a floating currency and primary surpluses, ideally large enough to bring public debt down. This “tripod” allowed it to move away from its hyperinflationary past, convinced ratings agencies to grant it an investment-grade badge and underpinned growth that propelled millions out of poverty. All this is now in jeopardy.

Brazil's economic woes, in charts Ms Rousseff is not the only one to blame. She had hoped to run a primary surplus, despite the recession, by resurrecting a tax on financial transactions that was abolished in 2007. But her political weakness put paid to that plan. At just 8%, her public-approval rating has hit depths unplumbed by any previous Brazilian president, undermining her authority in Congress. Lawmakers are also angered by her finance minister’s attempts to rein in pork-barrel spending, and alarmed by a wide-ranging investigation into corruption at the state-controlled oil giant, Petrobras. Knowing that the new tax would be unpopular—and hoping to weaken Ms Rousseff further—they made it clear that they would block it. Congress, Ms Rousseff’s advisers say, must now find a way to pay for the spending it refuses to cut. But it is stuffed with short-termists who are more concerned with lining their pockets than securing Brazil’s future. Many, both in the opposition and among her supposed allies, are wasting their energy trying to impeach Ms Rousseff, rather than finding a way to fix the budget. Unless this impasse is resolved quickly, business and consumer confidence will fall further and foreign investors will pull out. Brazil will be headed for a multi-year slump and a ratings downgrade.

Heaven can wait

So how might Brazil reach a primary surplus? By far the best solution would be to cut public spending, which accounts for more than 40% of GDP, much more than in other middle-income countries. Ms Rousseff has scaled back some discretionary spending, for example by promising to merge some ministries. But the 2016 budget includes plans to raise the minimum wage and many welfare payments by a whopping 10%. Congressional gridlock and a constitution that is chock-full of unaffordable spending commitments mean that only rarely have Brazilian governments managed to trim outgoings—and only under presidents endowed with remarkable political and leadership skills. Ms Rousseff falls far short of that ideal.

That leaves the sticking-plaster. The proposed financial-transaction tax would be, like so many Brazilian taxes, poorly designed and hard on growth. But it would still be better than ramping up spending with no way to pay for it. If not this tax, then some other is needed—and after that, the business of reforming Brazil’s greedy and profligate government.