Saudi Arabia has spent five months trying not to get dragged into a regional conflict, keeping open channels of communication with Tehran even as Iranian drones targeted its oil industry.

Now it appears hemmed in, facing enemies in three directions: Iran as well as its proxies in Iraq and Yemen.

In the last week, the kingdom has faced missile attacks from the Iranian-backed Houthis in Yemen, drone attacks from pro-Iranian militias in Iraq and renewed threats from Tehran.

Early Tuesday local time, it became clear restraint was no longer an option –– its fighter jets, along with US planes, carried out strikes across eastern Iraq.

But the stakes are high.

Getting embroiled in a broader conflict would be a risky and potentially costly option for Riyadh. Over the last decade it has been focused on opening the kingdom up to foreign investment and making it the regional economic powerhouse. That in part drove its policy of détente with Iran long before the war, which led to an agreement mediated by China in 2023.

That strategy is now on life support, as Saudi Arabia finds itself in the eye of a storm. Confronting unpredictable adversaries well-versed in asymmetrical warfare from three directions is a military planner’s nightmare.

Saudi Arabia has spent tens of billions of dollars modernizing its military and buying state-of-the-art missile defenses, but it has a huge landmass (about one-fifth the size of the United States), coastlines to defend and its oil infrastructure is widely dispersed.

At the weekend the Houthis fired missiles at two Saudi oil complexes on the Red Sea coast. Satellite images and geolocated video suggest extensive damage to one of those facilities, at Jazan near the border with Yemen.

The missile strikes followed Houthi attacks on two Saudi tankers in the Red Sea after the group announced a blockade of Saudi shipping transiting the Bab al-Mandeb chokepoint. The Houthis claimed a further attack on a Saudi vessel Monday.

For the Saudis, who have re-routed much of their oil exports through Red Sea ports such as Yanbu as Hormuz remains paralyzed, the blockade represents a major escalation.

They are planning a further expansion of oil exports via the Red Sea – to about 9 million barrels a day over the next three years. But tankers leaving Yanbu for Asian markets must transit Bab al-Mandeb, leaving about three-quarters of exports through the Red Sea exposed to Houthi disruption, analysts say.

Saudi Arabia spent seven years trying and failing to dislodge the Houthis from northern Yemen, launching a large-scale offensive against the militant group in 2015. The ensuing conflict provoked one of the worst humanitarian crises in the world.

A truce was arranged in 2022, but it never became a peace. Saudi Arabia maintained an economic and air blockade against Houthi-controlled areas.

Earlier this month, the Houthis accused Saudi Arabia of bombing the airport in the capital, Sanaa, to stop a direct flight from Tehran landing after it had ignored warnings to divert .

The flight was carrying a Houthi delegation returning from the funeral of Iran’s former Supreme Leader Ali Khamenei. But “attention was also focused on what else may have been transported aboard the aircraft,” says Nawaf Obeid of the Department of War Studies at King’s College London.

That set off the new cycle of violence, culminating in the missile attacks over the weekend.

“All the red lines have been crossed, all the (Saudi) buttons have been pushed (by the Houthis),” says analyst Mohammed al Basha.

A large force of Yemeni fighters hostile to the Houthis is assembling in the deserts of eastern Yemen, a regional source told CNN Monday. If it advances, it would be backed by the Saudi air force, including Apache attack helicopters.

But for now, the Saudi response is more likely to comprise air strikes, analysts say. On Friday, the Saudi air force targeted the port at Hodeidah, the largest under Houthi control, in retaliation for the tanker attacks.

The Saudi air force is far more capable than 10 years ago, according to Obeid , in detecting, tracking and engaging dispersed military threats. It has integrated systems in a way that “dramatically shortens the time between detection and engagement.”

But there is also the possibility that the Houthis can be bought off; they have frequently demanded cash for their huge payroll of public employees and militia.

“The Houthis appear to be following a North Korean playbook, using recurring cycles of provocation to extract political and economic concessions… turning their territories south of Saudi Arabia and the Red Sea into their stage,” according to Basha.

Whether they would turn their backs on their Iranian patrons for Saudi cash remains unclear.

Among the palm groves of southern Iraq, pro-Iranian militias launched two barrages of drones targeting critical Saudi infrastructure and the capital Riyadh on Monday and Tuesday, according to the Saudi defense ministry. The Houthis may have provided these militias with technical help, according to analysts.

Riyadh’s patience was exhausted. And early Tuesday, it “conducted precise and targeted strikes” against militias in eastern Iraq “linked to the attacks on petroleum facilities in the Kingdom,” according to the Defense Ministry.

There was a new red line. “The Kingdom emphasizes that it does not seek escalation but will respond to any aggression it faces,” the ministry added.

“A number of people” were killed and wounded in the strikes, according to the Popular Mobilization Forces, the umbrella group for the militia.

US Central Command (CENTCOM) said the joint operation was “a strong response” to over 30 drone attacks that it said had been directed by the Iranian Islamic Revolutionary Guard Corps.

In the first few weeks of the war, hundreds of drones were fired from Iraq towards US facilities in Saudi Arabia, according to CENTCOM. Despite the ceasefire in the conflict, a few more followed in May.

Saudi officials will not have forgotten the precise and devastating attack on the Abqaiq refinery in 2019, which took out nearly half of Saudi’s oil production.

The Houthis claimed that attack, but intelligence sources told CNN at the time that it had likely emanated from Iraq. In that instance, Saudi Arabia chose not to retaliate, but blamed Iran for the attack.

In March and April, Saudi authorities scrambled to invest in anti-drone technology as Iranian Shahed drones targeted oil installations on its east coast. Ukrainian President Volodymyr Zelensky visited Riyadh to offer an integrated defensive system to defend against the Iranian drone swarms.

But such an apparatus is not installed overnight. Saudi Arabia still faces the twin threat of Iranian drones and short-range ballistic missiles from across the Gulf.

While Iran has not targeted Saudi Arabia directly since April, its foreign ministry claimed again this week that “some countries of the Persian Gulf independently participated in military attacks on Iran. The US is responsible for the attacks, but the role of some regional countries cannot be ignored.”

Saudi Arabia did carry out some air strikes against Iran early in the conflict, but they were carefully calibrated, according to a diplomat familiar with events.

It was a proportionate response designed to show that the kingdom could defend itself “if the USA is not around,” the diplomat told CNN in May.

Should Saudi Arabia come under Iranian missile and drone attacks again, it could face un unpalatable choice: respond directly in a way that would draw it more deeply into war or turn the other cheek and embolden a Tehran regime that many see as more hardline than before the war.

Saudi Arabia already faces a significant economic hit from the conflict. In the first three months of this year, it recorded its biggest quarterly deficit since 2018 as it boosted spending to offset the effects of the war and a sluggish economy.

The deficit has been partially offset by higher revenues from more expensive oil, but further dislocation of oil production and exports would put that at risk. Many of the kingdom’s mega-projects have already been scaled back.

Ultimately, Saudi Arabia is in the middle of a neighborhood that looks more threatening and volatile than it did on February 28, the day the war started.

Saudi officials have been taken aback by the whiplash style of US President Donald Trump’s Iran and Gaza policies.

While Saudi-US military-to-military cooperation remains close, there’s a broader apprehension in Riyadh of being left alone to face a more belligerent and assertive Iran once US interest wanes.

The kingdom and its allies are at a crossroads. It doesn’t help that Saudi Arabia and the United Arab Emirates are only now beginning to repair relations scarred by the UAE’s sudden departure from the OPEC oil cartel, differences over the conflict with Iran, and a falling-out over who to back against the Houthis in Yemen.

Saudi Arabia has clearly now decided that there is only so much punishment it can absorb before striking back.