A GOLD rush in the late 19th century so enriched Charters Towers, an outback town in the state of Queensland, that it opened its own stock exchange. Trading ceased long ago. But the grand building still stands, its barrel-vaulted portico supported by eight slim pillars. Over a century later, Queensland is reeling from the demise of another mining boom. “There was a perception it would go on forever,” says Liz Schmidt, mayor of Charters Towers. But unlike so many other booms, this one has not ended in a national bust. Australia’s multi-pillared economy is still standing.

Given the violence of the commodity cycle, Australia’s resilience is remarkable. At its height, mining investment accounted for 9% of GDP (see chart). As the economy scrambled to meet China’s demand for iron ore and coal, Australia’s terms of trade spiked. The price of its exports, relative to its imports, reached the highest level since the gold rushes of the 1850s, according to Philip Lowe, governor of the Reserve Bank of Australia, the central bank.

Like those 19th-century scrambles, the China “rush” brought sudden prosperity to far-flung places. Townsville, a coastal city in north Queensland, hosted thousands of fly-in-fly-out workers (or “fifos”), who served the Bowen Basin’s coal mines and Mt Isa’s copper and zinc mines. Their six-figure salaries boosted the local economy and inflated the housing market, which attracted speculative investors from faraway Sydney, Melbourne and Brisbane. “There was so much money around,” says Peter Wheeler, a Townsville estate agent.

Similar booms elsewhere have ended in horrible busts. The turn in the commodity cycle helped condemn Brazil and Russia to brutal recessions. In China a sharp downturn in mining and metals prompted fears of a hard landing that still linger. Many argue that economic rebalancing and steady economic growth are incompatible goals.

That worry also gnawed at Australia. As commodity prices started falling, mining companies stopped investing in big projects. Fewer fifos landed in places like Townsville, depressing local spending and employment. Townsville’s house prices fell and its unemployment rate rose above 11%, almost double the national figure.

South of Townsville, around Gladstone, about 30,000 workers once had jobs building the state’s liquefied natural gas (LNG) industry; last year, the industry employed just 5,000. Similar stories can be found on the other side of the country. In Western Australia, where iron ore is a mainstay, the sinking economy appears to be pulling down the conservative government. It is likely to lose a state election on March 11th (see article).

These local difficulties could have added up to a national danger. When Australia’s economy registered a negative growth rate in the third quarter of 2016, some feared the worst: Australia might at last fall into recession (commonly defined as two consecutive quarters of negative growth), a fate it had avoided for 25 years.

But the wobble quickly passed. In the fourth quarter the economy regained momentum, growing by 2.4% compared with a year earlier. Australia’s GDP is now almost as big as Russia’s (if the two are compared at market exchange rates) and the Reserve Bank forecasts growth of about 3% this year and next. “We show that openness can deliver both prosperity and resilience,” argues Mr Lowe. 

Given how many economies succumbed to the global financial crisis or the commodity supercycle, Australia’s resilience may seem miraculous, another example of the luck for which the country is famous. But from another perspective, its performance should not be surprising at all. “It’s a textbook example of how a more open, flexible economy can handle these things,” argues Saul Eslake, an economist.

As the mining boom petered out, the Reserve Bank cut its benchmark “cash” rate from 4.75% in 2011 to 1.5%. The Australian dollar fell steeply (it is now worth $0.76, compared with a peak of $1.10 six years ago). The cheaper currency and lower interest rates have allowed the older and more populous states of New South Wales and Victoria to keep the economy bustling. Property developers are building more houses, farmers are exporting more food, and foreigners (both students and tourists) are paying more visits: Australia welcomed 1.2m Chinese last year, a record.

Just as Australia’s extractive industries benefited from China’s appetites, its property market has benefited from China’s anxieties: Australian homes are a popular investment for wealthy Chinese eager to move money somewhere safer. The fifos have also changed direction. Whereas people from Sydney and Melbourne once flew to Townsville seeking work, locals are now setting off to Australia’s two biggest cities in search of jobs, says Jenny Hill, Townsville’s mayor.

As well as rebalancing away from resources, Australia has also benefited from a rebalancing within the industry. Mining investment has given way to mining exports. Shipments of coal and iron ore helped Australia post a record trade surplus in the fourth quarter. The price of both has rebounded as China’s growth has stabilised. But investment is likely to remain subdued. Resource firms will use any improvement in revenues to “repair balance-sheets rather than invest in new capacity,” says Michael Roche, a consultant.

Townsville and Charters Towers have pinned their hopes on another rebalancing, from China to India. Adani, a firm based in the Indian state of Gujarat, wants to build what could be Australia’s biggest coal mine in the Galilee Basin, south-west of Townsville. It has spent about A$3.2bn ($2.4bn) buying leases and fighting court petitions against the project from environmental and indigenous groups.

The state and federal governments support the scheme because of the jobs it would bring. Adani has applied for a federal loan to help build a 380km railway line across the outback to a port at Abbot Point, near the Great Barrier Reef, from where coal would be shipped to India. Matt Canavan, the federal resources minister, is “open to suggestions of a subsidy”. He predicts a “devastating impact on Queensland’s confidence” if the project does not go ahead.

In Charters Towers the old stock-exchange building is itself an elegant monument to economic reversals and renewal. It was restored in the 1970s and added to Queensland’s “heritage register”, partly because it “evokes the rise and fall of fortunes typically connected with goldfield towns”. The building is now home to an art gallery, a museum and the office of a local politician. At one point it even hosted a beauty parlour offering “microdermabrasion” to smooth out pockmarked skin. Thanks in part to this capacity for reinvention, Australia’s economic record remains remarkably unblemished.