BEIRUT, Lebanon — Even as Iran and Saudi Arabia supported opposite sides in a bitter and bloody proxy war in Syria, the two adversaries managed to preserve a tense calm just over the border in Lebanon, where they have long competed for influence.

Now, suddenly, it looks as if Saudi Arabia is walking away — leaving Lebanon perhaps more firmly than ever in the grip of Hezbollah and its patron, Iran.

Instead of vying behind the scenes to counter Iran, as it has for decades, the kingdom has taken to punishing Lebanon for Hezbollah’s siding with Iran in Syria. It has slashed billions of dollars in aid, ordered Saudi tourists to avoid the Mediterranean nation, and, on Wednesday, declared Hezbollah, Lebanon’s most powerful political, social and armed organization, a terrorist group.

Suddenly, this sliver of a nation, long beloved by Saudis for its night life, beaches and mountains, is once again thrust into the middle of the battle for regional dominance between Shiite Iran and Sunni Saudi Arabia. The consequences could be enormous for a nation that barely survived its own civil war, borders Israel, hosts well over a million Syrian refugees and relies on a shaky power-sharing arrangement between sects for its own stability.