This article is a joint publication of Foreign Policy In Focus and TheNation.com.

For the past eight decades Saudi Arabia has been careful.

Using its vast oil wealth, it’s quietly spread its ultra-conservative brand of Islam throughout the Muslim world, secretly undermined secular regimes in its region, and prudently kept to the shadows while others did the fighting and dying. It was Saudi money that fueled the Mujahedeen in Afghanistan, underwrote Saddam Hussein’s invasion of Iran, and bankrolled Islamic movements and terrorist groups from the Caucasus to the Hindu Kush.

It wasn’t a modest foreign policy, but it was a discreet one.

Today that circumspect diplomacy is in ruins, and the House of Saud looks more vulnerable than it has since the country was founded in 1926. Unraveling the reasons for the current train wreck is a study in how easily hubris, delusion, and old-fashioned ineptness can trump even bottomless wealth.

Oil Slick

The kingdom’s first stumble was a strategic decision last fall to undermine competitors by scaling up its oil production and thus lowering the global price.

They figured that if the price of a barrel of oil dropped from over $100 to around $80, it would strangle competitors that relied on more expensive sources and new technologies, including the U.S. fracking industry, companies exploring the Arctic, and emergent producers like Brazil. That, in turn, would allow Riyadh to reclaim its shrinking share of the energy market. There was also the added benefit that lower oil prices would damage oil-reliant countries that the Saudis didn’t like — including Russia, Venezuela, Ecuador, and Iran.

In one sense it worked. The American fracking industry is scaling back, the exploitation of Canada’s tar sands has slowed, and many Arctic drillers have closed up shop. And indeed, countries like Venezuela, Ecuador, and Russia have taken serious economic hits.

But it may have worked a little too well, particularly with China’s economic slowdown reducing demand and further depressing the price — a result that should have been entirely foreseeable but that the Saudis somehow missed.

The price of oil dropped from $115 a barrel in June 2014 to around $44 today. While it costs less than $10 to produce a barrel of Saudi oil, the Saudis need a price between $95 and $105 to balance their budget. The country’s leaders, who figured that oil wouldn’t fall below $80 a barrel — and then only for a few months — are now burning through their foreign reserves to make up the difference.

While oil prices will likely rise over the next five years, projections are that the price per barrel won’t top $65 for the foreseeable future. Saudi debt is on schedule to rise from 6.7 percent of GDP this year to 17.3 percent next year, and its 2015 budget deficit is $130 billion.

The country is now spending $10 billion a month in foreign exchange reserves to pay the bills and has been forced to borrow money on the international financial market. Recently the International Monetary Fund’s regional director, Masood Ahmed, warned Riyadh that the country would deplete its financial reserves in five years unless it drastically cut its budget.

Buying the Peace (While Funding War)

But the kingdom can’t do that.

When the Arab Spring broke out in 2011, Saudi Arabia headed it off by pumping $130 billion into the economy, raising wages, improving services, and providing jobs for its growing population. Saudi Arabia has one of the youngest populations in the Middle East, many of whom are unemployed and poorly educated. Some 25 percent of the population lives in poverty. Money keeps the lid on, but — even with the heavy-handed repression that characterizes Saudi political life — for how long?

Meanwhile they’re racking up bills with ill-advised foreign interventions. In March, the kingdom intervened in Yemen’s civil conflict, launching an air war, a naval blockade, and partial ground campaign on the pretense that Iran was behind one of the war’s factions — a conclusion not even the Americans agree with.

Again, the Saudis miscalculated, even though one of their major allies, Pakistan, warned them they were headed for trouble. In part, the kingdom’s hubris was fed by the illusion that U.S. support would make it a short war. The Americans are arming the Saudis, supplying them with bombing targets, backing up the naval blockade, and refueling their warplanes in mid-air.

But six months down the line the conflict has turned into a stalemate. The war has killed 5,000 people (including over 500 children), flattened cities, and alienated much of the local population. It’s also generated a horrendous food and medical crisis and created opportunities for the Islamic State and al-Qaeda to seize territory in southern Yemen. Efforts by the UN to investigate the possibility of war crimes were blocked by Saudi Arabia and the U.S.

As the Saudis are finding out, war is a very expensive business — a burden they could meet under normal circumstances, but not when the price of the kingdom’s only commodity, oil, is plummeting.

Nor is Yemen the only war that the Saudis are involved in. Riyadh, along with Qatar and the United Arab Emirates, are underwriting many of the groups trying to overthrow Syrian president Bashar al-Assad. When anti-government demonstrations broke out there in 2011, the Saudis — along with the Americans and the Turks — calculated that Assad could be toppled in a few months.

But that was magical thinking. As bad as Assad is, a lot of Syrians — particularly minorities like Shiites, Christians, and Druze — were far more afraid of the Islamists from al-Qaeda and the Islamic State than they were of their own government. So the war has dragged on for four years and has now killed close to 250,000 people.

Once again, the Saudis miscalculated, though in this case they were hardly alone. The Syrian government turned out to be more resilient than it appeared. And Riyadh’s bottom line that Assad had to go just ended up bringing Iran and Russia into the picture, checkmating any direct intervention by the anti-Assad coalition. Any attempt to establish a no-fly zone against Assad will now have to confront the Russian air force — not something that anyone other than certain U.S. presidential aspirants are eager to do.

The war has also generated a flood of refugees, deeply alarming the European Union, which finally seems to be listening to Moscow’s point about the consequences of overthrowing governments without a plan for who takes over. There’s nothing like millions of refugees headed in your direction to cause some serious re-thinking of strategic goals.

The Saudis goal of isolating Iran, meanwhile, is rapidly collapsing. The P5+1 — the U.S., China, Russia, Great Britain, France, and Germany — successfully completed a nuclear agreement with Tehran, despite every effort by the Saudis and Israel to torpedo it. And at Moscow’s insistence, Washington has reversed its opposition to Iran being included in peace talks around Syria.

Bills Coming Due

Stymied in Syria, mired down in Yemen, and its finances increasingly fragile, the kingdom also faces internal unrest from its long marginalized Shia minority in the country’s east and south. To top it off, the Islamic State has called for the “liberation” of Mecca from the House of Saud and launched a bombing campaign aimed at the Kingdom’s Shiites.

This fall’s Hajj disaster — a stampede that killed more than 2,100 pilgrims and provoked anger at the Saudi authorities for their foot dragging on investigating it — have added to the royal family’s woes. The Saudis claim just 769 people were killed, a figure that no other country in the world accepts. And there are persistent rumors that the deadly stampede was caused when police blocked off an area in order to allow high-ranking Saudis special access to the holy sites.

Some of these missteps can be laid at the feet of the new king, Salman bin Abdulaziz Al Saud, and of a younger, more aggressive generation of Saudis he’s appointed to key positions. But Saudi Arabia’s troubles are also a reflection of a Middle East in transition. Exactly where it’s headed is by no means clear, but change is in the wind.

Iran is breaking out of its isolation. With its large, well-educated population, strong industrial base, and plentiful energy resources, it’s poised to play a major regional, if not international, role. Turkey is in the midst of a political upheaval, and there’s growing opposition among Turks to Ankara’s meddling in the Syrian civil war.

Saudi Arabia, on the other hand, is impaled on its own policies, both foreign and domestic. “The expensive social contract between the Royal family and Saudi citizens will get more difficult, and eventually impossible to sustain if oil prices don’t recover,” Meghan L. O’Sullivan, director of the Geopolitics of Energy project at Harvard, told the New York Times.

However, the House of Saud has little choice but to keep pumping oil to pay for its wars and keep the internal peace. Yet more production drives down prices even further. And once the sanctions come off Iran, the oil glut will become worse.

While it’s still immensely wealthy, there are lots of bills coming due. It’s not clear the kingdom has the capital or the ability to meet them.