CAIRO — The Shiite leaders of Iran and the Sunni rulers of Saudi Arabia traded insults over the deaths of hundreds of Iranian pilgrims near Mecca. The government of Bahrain, long criticized for repressing the country’s Shiite majority, expelled the Iranian ambassador, after accusing Iran of shipping arms to Bahrain and trying to foment “sectarian strife.”

And a group of hard-line Sunni clerics in Saudi Arabia, fired up by Russia’s intervention in Syria, issued a scathing sectarian call for holy war.

Events over the last few weeks have raised fears of an accelerating confrontation between the region’s Shiite and Sunni Muslims, with Saudi Arabia and Iran escalating their power struggle, extremists attacking Shiite mosques in the Persian Gulf and armed conflict aggravating religious differences in Iraq, Syria and now Yemen.

But as the violence flares and crosses borders, national and religious leaders seem as eager as ever to stoke the fires, mobilizing followers using implicit or naked sectarian appeals that are transforming political conflicts into religious struggles and making the bloodshed in the region harder to contain, scholars and analysts say.

“This is unprecedented, and we don’t have a road map,” said Rami Khouri, a senior fellow at the Issam Fares Institute at the American University of Beirut. “When political dynamics fail, people turn back to religion. We are in this terrible moment of transition where sect is very high in people’s minds.”

“Radical individuals are deliberately fomenting this violence,” he added. “And irresponsible governments allow it to happen.”

The perils of sectarian polarization have been evident for more than a decade, since the United States-led invasion and occupation of Iraq. In the last few years, tensions have been inflamed by the war in Syria.

The latest violent turn has been “ratcheted up by the Iranian-Saudi conflict,” Mr. Khouri said. Iran’s latest broadsides over the pilgrims’ deaths near the Saudi city of Mecca during the hajj came as the Gulf states have taken an increasingly hard line against what they call Iran’s meddling in the region — going so far as to mount a large-scale military offensive in Yemen aimed at defeating a rebel group they say is allied with the Iranians.

As the Sunni monarchies have rallied their citizens for war, the rulers seem ill prepared for the potential fallout: Several times over the last few months, Sunni extremists have carried out deadly attacks on Shiite mosques in the Persian Gulf. The latest was on Friday, when a gunman in Saudi Arabia’s Eastern Province killed five Shiite worshipers.

Troubling another fault line, Russia’s decision to intervene in Syria alongside the government of President Bashar al-Assad, Iran and Hezbollah, the Lebanese Shiite militia, brought calls for retaliation from hard-line Saudi clerics known as Salafis, but also mainstream Islamist groups like the Muslim Brotherhood in Egypt, which referred to Mr. Assad as a “treacherous Alawite criminal.”

The Saudi clerics, denigrating their longtime adversaries, including Shiite Muslims and Alawites, who practice an offshoot of Shiite Islam, also took aim at the “Orthodox crusader Russia,” which they said was picking up where the Soviet force driven from Afghanistan by Muslims more than a generation ago had left off.

In an online statement signed by 55 clerics, they warned that if the “holy warriors” were defeated in Syria, Sunni nations would also fall “one after the other.”

Madawi al-Rasheed, a visiting professor at the Middle East Center of the London School of Economics, said the strong sectarian tone of the statement represented the sort of pronouncements that have made the region’s hostilities harder and harder to arrest.

“The language of sectarianism involves elimination and purification, and these are very dangerous words to use in any conflict,” Dr. Rasheed said. “It makes it more difficult to see a space for dialogue and political solutions or compromises. Religious conflicts are more difficult to resolve than political ones.”

By invoking Afghanistan, the letter “conjured the image of martyrdom and fighting the infidels,” she said, portending “a longer war.”

Hassan Hassan, an associate fellow at Chatham House in Britain and a co-author of “ISIS: Inside the Army of Terror,” said that Russian involvement in Syria had the potential to be a “mobilizing factor” for Sunnis, and not just extremists. There are ordinary people angered by the war and convinced that the great powers, including the United States, are colluding to prop up Mr. Assad’s government.

“You don’t have to be a jihadist to think this is a dirty game,” he said.

The latest irritant is the war in Yemen, where a coalition of Sunni states, backed by the United States, is fighting a Shiite-led rebel group known as the Houthis. The Saudi-led coalition has framed the intervention in part as an effort to beat back the regional influence of Iran.

 “There was a collective Gulf need to stand up to expansionist Iran,” Abdulkhaleq Abdulla, a professor of political science from the United Arab Emirates, wrote last week in an opinion piece in Gulf News, explaining the decision by the Emirates to go to war. “Yemen was the place to draw the line.”

Many outside observers, including former and current United States officials, believe the Gulf states have wildly overstated the degree of Iranian influence over the Houthis. And the rebels, also exaggerating, have sent fighters, including teenagers, to battle, with the admonition that all their opponents are Sunni extremists.

Yemen has been left to face the increasingly ominous consequences of the war, including a sharpening of sectarianism. As states become weaker, as in Syria and Iraq, the absence of a dominant political authority creates the conditions in which extremism and appeals to religious identity flourish, analysts say.

“There is no leadership, no government and no state,” said Farea al-Muslimi, a visiting scholar from Yemen at the Carnegie Middle East Center in Beirut. “There is no national agenda, and a lot of guns.”

He said that signs of greater polarization had started to emerge in the last few years, as the Houthis battled Salafis in northern Yemen. In the lead-up to the war in March, the Houthis stormed Sana, the capital, and escalated their conflict with hard-line Sunnis, including Al Qaeda’s local branch. Moderate political figures were assassinated by gunmen in the streets of Sana and Aden, in the south.

One day, a Saudi satellite channel reported a suicide attack at a mosque after the war started, referring to the place as a “Houthi mosque,” Mr. Muslimi said, though Yemen’s Zaydi Shiites are considered doctrinally closer to Sunni than to mainstream Shiite Islam, and Shiites and Sunnis often worship together.

 “I thought, ‘We have crossed a line. Welcome to Iraq. Welcome to Syria,’ ” Mr. Muslimi said.

With armies, religious militias and extremist groups on the march across the region, “the moderates have lost,” said Dr. Abdulla, the Emirati professor.

“The forces of extremism have been unleashed in a powerful way we have not seen before,” he said. “Is this the furthest we can go? Maybe not.”

This article was published on the New York Times