News this week that the Saudi government is to raise more than $27bn from bond sales is a sign that the strain of getting involved in a spending battle with the world’s biggest economy is taking its toll.

Saudi Arabia is an expensive country to run for the House of Saud. Fearful of Iran, it has imported the latest military kit to show that it is the Middle East’s regional superpower. Higher defence spending has also been needed to fund action in Yemen and to counter the threat from Islamic State. In addition, Saudi Arabia has an unemployment problem that it fears may become a social unrest problem. Two-thirds of the population is under 30 and the unemployment rate for the 16-29 age group is 29%.

As the CIA puts it in its World Factbook: “Over 6 million foreign workers play an important role in the Saudi economy, particularly in the oil and service sectors, while Riyadh is struggling to reduce unemployment among its own nationals. Saudi officials are particularly focused on employing its large youth population, which generally lacks the education and technical skills the private sector needs.”

The Saudi royal family decided the way to ensure that it was not toppled by the Arab spring was to throw money at millions of potentially angry young men. That, too, is expensive for a country where there is no income tax and petrol costs less than 10p a litre.

All this was affordable while oil prices were well above $100 a barrel. The sums don’t add up when a barrel of Brent crude is changing hands for less than $50, and this explains why the International Monetary Fund estimates that Saudi Arabia is on course to run a budget deficit of 20% of national income this year. To put that figure into perspective, at its worst following the deep recession of 2008-09, Britain was running a budget deficit of 11% of GDP.

Like many oil-producing countries, Saudi had got used to an era of high oil prices. Kuwait and Abu Dhabi can live with crude at its current level: Saudi Arabia cannot. It requires an oil price of $106 a barrel to balance the books.

But the chances of high oil prices persisting was threatened by the rapid development of the US shale industry, which expanded the supply of cheaper oil. Hence the decision by Saudi Arabia to drive the American producers out of business by pushing the cost of crude down to levels that made the new US fields unviable. The Saudis decided the short-term pain was worth it for the long-term gain and kept on pumping even when the oil price was collapsing.

Because oil accounts for almost 90% of Saudi Arabia’s revenues, a black hole quickly opened up in the budget. That was filled initially by running down the country’s reserves, which had been built up to exceed $700bn, by $65bn in the past year. This could not go on indefinitely, not least because the reserves have a dual function – to smooth out the budget and to act as a sovereign wealth fund for the benefit of future generations.

The Saudis’ bond issue is affordable given that the country’s national debt was just 1.6% of GDP in 2014 and rock-bottom global interest rates mean borrowing is cheap. But the need to resort to the financial markets demonstrates the resilience of the US shale sector.

New projects, for which the break-even price of oil needs to be well above the current level, have been mothballed. But producers in existing fields have found new and cheaper ways of extracting oil. As a result, the number of fields has gone down, while production per field has gone up.

The US is producing more oil than it has done for more than four decades, a fact recognised by Saudi Arabia’s central bank, which noted in a recent report that “it is becoming apparent that non-Opec producers are not as responsive to low oil prices as had been thought, at least in the short run.” It added that Opec producers such as Saudi Arabia should be patient and wait for demand to catch up with supply. Judging by the price of oil in futures markets, this could take some time.

The cold war ended when attempts by the Soviet Union to match American military spending wrecked the economy. Riyadh has been using its vast reserves of crude to kill off the US shale industry. But there has been no knockout blow. Instead, the bond issue suggests the Saudis are now embroiled in a long – and expensive – war of attrition. And one they may not win.

