FOR more than a decade, Australia had enjoyed one of the biggest booms in its history, and a robust series of budget surpluses. When Kevin Rudd led the Labor Party to power in 2007, he promised, as a “fiscal conservative” to keep this ball rolling. But when Wayne Swan, his treasurer (finance minister), presented the government's second budget on May 12th, the ball had suddenly stopped. Mr Swan delivered an underlying cash deficit for 2009-10 of almost A$58 billion ($44 billion), or 4.9% of GDP, one of the largest ever. Only last year, an A$20 billion surplus was forecast. The lucky country's reversal of fortune could hardly have been starker.

It mirrors the global downturn, but especially that in China, Australia's biggest trading partner. Just before the budget, the central bank revised earlier hopes that Australia might plough through all this. It says the economy has been contracting since late last year, and it will shrink by 0.5% up to mid-2010. This may sound mild compared with other rich countries. But the slump in commodity markets and prices has blown a hole in record company profits that underwrote much of the boom. The Treasury says that tax revenues over the next four years will now be A$210 billion less than expected.

This posed a stark choice for Mr Rudd. He has promised big spending on health, education and attacking climate change. Now, he has either to find some way of financing his plans, such as tax hikes, or to drop them. He chose neither course. Buoyed by public and pundit support for two stimulus packages since October, he turned the budget largely into a third stimulus. It invests A$22 billion in infrastructure, including ports, interstate roads and new railways in Australia's big cities. Clean-energy projects, mainly solar and carbon capture from burning coal, will get A$4.5 billion. Under pressure from an unlikely alliance of business and greens, Mr Rudd recently delayed by a year his plan for an emissions-trading scheme from 2010. The green budget measure turns the pressure back on his critics.

Mr Rudd plans to pay for all this by finding savings roughly equal to the infrastructure outlays. Richer Australians will sacrifice most. The government will slash tax breaks for private health insurance, pension contributions and other forms of middle-class welfare. Nevertheless, the government faces net debt to the tune of almost A$200 billion in four years from money it will have to borrow to cover projected deficits.

But luck has not entirely deserted Australia. Having shunned toxic assets, its four big banks look healthy. The Treasury is predicting that growth will return to boom levels of 4.5% in just two years. That must assume China's demand for Australia's commodities revives. The contraction, meanwhile, is expected to raise unemployment to 8.5%, or about 1m people, by mid-2011. This will worry Mr Rudd as he faces an election by the end of 2010. For now, he has avoided imposing quite the horror budget many had feared.