Last month, Lebanon’s prime minister, Saad Hariri, resigned in Saudi Arabia — only to later rescind his resignation. This sparked fear of a Saudi-backed war against Hezbollah, Iran’s Lebanese ally. Riyadh has few local military assets to confront the Shiite movement but could strangle Lebanon’s small open economy. Lebanon is deeply reliant on capital inflows from the Gulf. The immediate crisis of Hariri’s premiership is over, but Lebanese economic dependency persists. It is dangerous if the country must stay in Riyadh’s political good grace to avoid economic crisis.

Three Gulf countries accounted for 76 percent of new foreign direct investment projects in Lebanon from 2003 to 2015. Remittances averaged about 20 percent of the country’s GDP annually over the past 10 years — with an estimated 60 percent coming from Gulf countries. How Lebanon came to rely on these inflows is key to understanding its dependency on the Gulf and Saudi Arabia in particular.

Gulf tycoons and reconstruction

The 1970s oil boom enriched contractors in the Gulf, among them Rafiq Hariri (father of the current prime minister), Najib Miqati and Issam Fares. When the Lebanese civil war ended in 1990, this “contractor bourgeoisie” returned: The former two became prime ministers, the latter deputy prime minister. Rafiq Hariri was the most successful politically — not because he was the wealthiest, but because he acted as Saudi Arabia’s local ally, first in civil war diplomacy, then from 1992 as prime minister.

Riyadh did not dictate postwar reconstruction, but it empowered Hariri to open the door for fellow Gulf investors. The tycoon rebuilt central Beirut as a luxury real estate project drawing in Gulf funds. Hariri-appointed economists in the central bank and finance ministry pegged the Lebanese currency to the U.S. dollar in 1999. Maintaining this signal of macroeconomic propriety required high interest rates, which inflated government debt. Inflows of Gulf capital are crucial to debt servicing.

Exorbitant debt and loyal investors

By 2016, Lebanon’s government debt skyrocketed to 144 percent of GDP — only topped by Japan and Greece. Lebanon relies on continuous inflows of outside capital to maintain the peg.

Lebanon’s financial system limps on because government debt is not held by fickle global investors but by Lebanon’s more lenient commercial banks. They would collapse if the government were to default, so banks and sovereign are in a mutual hostage situation. Banks refinance government lending by drawing in deposits, especially from the Gulf-based diaspora. Any disruption of these flows would push the system to the brink.

An International Monetary Fund estimate suggests about 1 percent of all accounts hold roughly half of total deposits. Banks are politically well-connected, including the Hariri-owned Bankmed. Lebanese banks and depositors constitute a “loyal investor base” that is happy to stick out crises.

Saudi Arabia forestalls financial collapse

Even the most loyal investor would abandon Lebanon if the system became unsustainable. Saudi Arabia is what keeps the confidence game going. A 2008 IMF working paper found that investors perceive an “implicit guarantee” from international donors. This perception started around 2002 when the system came under extensive strain. In November 2002, Rafiq Hariri assembled a donor conference in Paris, where Saudi Arabia led other Gulf Arab states in providing the bulk of aid pledges. Saudi Arabia had saved the Lebanese financial system — and investors were now looking to Riyadh for reassurance.

Rafiq Hariri’s assassination in 2005 was the first of a series of political crises that threatened financial turmoil. Saudi Arabia reassured jittery investors. During the 2006 war between Israel and Lebanon, Saudi Arabia and Kuwait deposited a combined $1.5 billion in Beirut’s central bank to prop up the currency. In 2008, Saudi Arabia announced that it would deposit an additional $1 billion.

Saudi aid came with political motivation. The kingdom supported a coalition of Lebanese forces that opposed Syrian and Iranian influence. It was dubbed “March 14” and was led by Saad Hariri. The high point of Saudi political support was the 2009 parliamentary election, in which the kingdom reportedly funded anti-Hezbollah candidates to the tune of several hundred thousand dollars.

Saudi support grows uncertain

In 2011, Hezbollah withdrew its support for a unified government headed by Hariri, forcing him to step down and go into self-imposed exile in Riyadh and Paris for fear of assassination. As Hariri’s star waned, Saudi financial support grew uncertain. In 2013, the Gulf countries were discussing visa restrictions for Lebanese workers. This was supposed to prevent Hezbollah infiltration in the Gulf but also threatened to curtail Gulf remittances, Lebanon’s economic lifeblood.

Meanwhile, falling oil prices led to a curtailment of Saudi government contracts. One of the victims was Hariri-owned construction giant Saudi Oger, which stopped paying workers in 2015. The end of the Saudi royals’ commercial relationship with Hariri did not bode well for their political relationship — the two had always been closely intertwined. In February 2016, the Saudi government withdrew its promised $3 billion aid package to the Lebanese army over the Lebanese government’s failure to distance itself from Iran. The central bank had to resort to complicated “financial engineering” to keep deposits flowing.

The question last year was whether Hariri would be able to revive both his political career and Saudi economic support for Lebanon. In October 2016, Hariri endorsed the bid of Hezbollah’s preferred candidate for the presidency. Lebanon’s power-sharing system meant that Hariri had to compromise with Hezbollah to become prime minister — yet such a compromise clashed with Saudi determination to confront Iranian influence. Hariri reportedly believed he had Saudi backing for another international donor conference in Paris, hoping that his return to government would be able to restore overt Saudi economic support.

Hariri’s humiliating resignation in November and the ensuing back-and-forth instead conjured the specter of a Saudi economic attack on Lebanon akin to the embargo of Qatar. Restrictions on Lebanese workers in the Gulf would cut remittances and topple its currency. The economy remains Riyadh’s sharpest weapon for future confrontations, but an attack on banks and depositors would do little damage to Hezbollah. Hariri is back as prime minister and is trying to patch things up with Hezbollah — but the tussle between Saudi Arabia and Iran over Lebanon persists.

Hannes Baumann is a lecturer in the Department of Politics, University of Liverpool, and author of “Citizen Hariri: Lebanon’s Neoliberal Reconstruction.”