THE REGIONAL sectarian war that has always been one of the greatest dangers of the crisis in Syria is alarmingly close to erupting. To the west of Damascus, Lebanon’s Shiite Hezbollah militia has publicly committed itself to defending the regime of Bashar al-Assad, and Syrian opposition sources say it has been instrumental in the regime’s recent battlefield gains. Apparent Iranian attempts to transfer advanced weapons to Hezbollah have provoked at least one Israeli airstrike in Syria in recent days.

Even more disturbing is what is happening to Syria’s east: the bloodiest confrontation between Iraq’s minority Sunni community and the Shiite regime since the withdrawal of the last U.S. troops nearly two years ago. According to a count by the Associated Press, at least 218 people have been killed in gun battles and bombings since the Iraqi army stormed a Sunni protest encampment near Kirkuk on April 23. The United Nations says 712 people died in political violence during April, the most since 2008.

As former ambassador to Iraq Ryan C. Crocker wrote on the opposite page last Wednesday, these events “are reminiscent of those that led to a virtual civil war in 2006.” But there are two differences: There are no U.S. troops available to tamp down the violence, as happened during the Iraq “surge”; and the fighting could easily merge with that in Syria and spread to Lebanon.

Already, the al-Qaeda organizations in Syria and Iraq have proclaimed a joint “emirate;” the strongholds of the two groups are adjacent to each other along the border. Shiite militiamen from Iraq are believed to be fighting on the side of the regime in Syria, and the Iraqi government of Nouri al-Maliki has been turning a blind eye to shipments of Iranian arms and fighters to Syria, despite repeated demarches from the Obama administration.

Much of the trouble in Iraq stems from the enduring failure of the country’s elite to overcome political and economic disputes grounded in sectarianism. The Sunni and Kurdish communities believe that Mr. Maliki and Shiite politicians have failed to deliver on promises to decentralize power and distribute resources fairly. Mr. Maliki has mostly moved in the opposite direction, consolidating his authority and targeting Sunni leaders for arrest and prosecution on often-dubious charges. Though Iraq held local elections last month, the vote in two majority-Sunni provinces was put off until July.

Yet Mr. Maliki’s behavior has been driven in large part by Syria. The Shiite leader fears that a victory by the mostly Sunni opposition in Syria, with support from the Sunni regimes of Turkey, Saudi Arabia and Qatar, would lead to an attempt to restore Sunni dominance in Iraq, as during the era of Saddam Hussein. Iraqi officials point out that groups preparing for war in Iraq’s Sunni areas include not just al-Qaeda but also an organization of former militants of Hussein’s secular Baathist party.

The resumption of sectarian war in Iraq alongside that of Syria would be devastating for the Middle East — and for the interests of the United States. The fragile gains of the Iraq war — a nation at peace with its neighbors and a partner of the United States — would be wiped out, and committed U.S. enemies such as al-Qaeda and Hezbollah would surge. The situation demands, as Mr. Crocker put it, “a sustained, high-level diplomatic effort by the United States” in Iraq. But it also makes intervention aimed at ending the war in Syria that much more urgent.