Wouldn’t it be ironic if the popular awakening sweeping the Middle East had the unintended effect of undermining the one established Arab democracy?

On Friday, Lebanese Prime Minister Najib Mikati resigned. His departure followed a stand-off over extending the term of a senior official responsible for internal security and a new national election law, but it had every sign of being sparked by the civil war unfolding across the border in Syria, which has become increasingly sectarian. At the heart of last week’s events in Lebanon lies Hezbollah, the armed group whose members have been covertly fighting to keep the Syrian dictator, Bashar al-Assad, in power. (On assignment recently in Lebanon, I reported on Hezbollah’s unacknowledged activities inside Syria itself, where I outlined the group’s efforts to prop up Assad’s murderous regime.) It now appears increasingly likely that the Syrian civil war will ignite some kind of sectarian strife inside Lebanon as well.

Lebanon is a small country with only four million people, but it’s an extraordinarily diverse place that nearly every government in the Middle East has struggled to dominate. Since 1990, when its own civil war ended, Lebanon has maintained a fitful but functioning democracy, one that relies on a delicate balance of power among its main sectarian groups: the Christians, the Sunnis, the Shia, and the Druze.

Since 1990, the greatest threat to Lebanon’s democracy has been the Syrian regime of Assad and his local proxies, Hezbollah. Like his father before him, Assad has sought to dominate Lebanon, truncating its politics and extracting millions of dollars from its economy. Hezbollah, in turn, has used its Syrian cover to nurture its own army, which is stronger than that of the Lebanese state. Even after Syrian forces were forced to withdraw from Lebanon in 2005 following the assassination of the former Lebanese Prime Minister Rafik Hariri, Assad and his satraps continued to manipulate Lebanese politics, often by assassinating their Lebanese opponents. Both Syria and Hezbollah rely heavily on Iran; Syria provides the crucial conduit for Hezbollah’s money and weapons.

Now, of course, the Assad regime is fighting for its survival, as much of its own population has risen up against it. The crucial aspect of the Syrian war, as regards Lebanon, is its sectarian nature. The Assad regime is dominated by members of the Alawite sect, which considers itself an offshoot of Shia Islam, the religion of Hezbollah (and of the Iranian regime).

As the civil war in Syria has carried on, it has dragged more and more of Lebanon along with it. Terrified that it will lose its supply lines, Hezbollah has not been content to sit on the sidelines and watch Assad fall; its leaders have been sending fighters into Syria to fight for the Assad regime, actions that are supposed to be secret but that are widely known in Lebanon. That, in turn, has severely strained Hezbollah’s relations with other Lebanese, especially its Sunnis, who accuse Hezbollah of killing their brethren across the border. At least four hundred thousand Syrian refugees, most of them Sunnis, have gathered in Lebanon. The peace has held in Lebanon, but the Sunni anger is swelling.

This brings us to the resignation of Prime Minister Mikati. Under longstanding national agreement, the Prime Minster must be a Sunni. (The President must be a Christian; the Speaker of Parliament a Shiite.) Since taking office in 2011, Mikati has presided over a coalition whose most powerful partner is Hezbollah—which, in addition to being an army, is also a political party. Hezbollah’s activities inside Syria have been putting enormous pressure on Mikati, who is seen as the leader of the country’s Sunnis. Those pressures came to a head last week.

The immediate issue was the extension of the term of Major General Ashraf Rifi, chief of the Internal Security Forces. Rifi is a Sunni and close to the Lebanese opposition, which is staunchly opposed to the Syrian leader and friendly with the West. Hezbollah, which dominates Mikati’s cabinet, refused to extend Rifi’s term.

Hezbollah’s intense dislike for the Internal Security Forces is well known: in October, the head of intelligence for the same agency, General Wissam al-Hassan, also an ally of the United States, was blown up by a car bomb. Many people in Lebanon suspected that Hezbollah or the Syrian government were behind the attack. Among other things, Hassan, and the I.S.F. more generally, had pushed for the indictment of four Hezbollah members in the assassination of Hariri. Hezbollah regards the investigation as a pro-Western put-up job. But the decisive point is that, with civil war raging next door, Hezbollah is clearly trying to make the Lebanese state more friendly to Assad.

The other issue was a dispute over a new election law, which is supposed to be approved before new parliamentary elections can be held in June. The deadlock over the law appears to reflect a growing sense of strength among Lebanon’s Sunnis, particularly vis-à-vis Hezbollah, as the Sunni opposition in Syria strengthens as well.

If Lebanon’s President, Michel Suleiman, accepts Mikati’s resignation, as he seems likely to do, the country could be entering a protracted political crisis, without a functional government. That kind of power vacuum, in a country as fragile as Lebanon, could lead to sectarian violence. Mikati himself, in his televised statement on Friday, seemed to hint at just such a possibility. “The region is heading toward the unknown,’’ he said.

Indeed it is. For all Lebanon’s travails, its democracy has been an example to its neighbors. It would be especially sad if it became a victim.

Photograph by Moises Saman/Magnum