RIFFA, Bahrain — Black and yellow concrete barricades block the roads entering this wealthy Sunni enclave, where foreign-born Sunni soldiers in armored personnel carriers guard the mansions of the ruling family and the business elite.

Beyond the enclave are impoverished villages of Shiites, about 70 percent of Bahrain’s more than 650,000 citizens, where the police skirmish nightly with young men wielding rocks and, increasingly, improvised weapons like homemade guns that use fire extinguishers to shoot rebar.

Their battles are an extension of sectarian hostilities nearly as old as Islam. But they are also a manifestation of a radically new scramble for power playing out across the region in the aftermath of the United States invasion of Iraq and the Arab Spring revolts.

This island nation off the eastern coast of Saudi Arabia was the first place where Arab Spring demands for equal citizenship and democratic governance degenerated into a sectarian feud, and at first it seemed to be an anomaly. But Bahrain’s experience now appears to have been a harbinger of what was to come as centuries old but newly inflamed rivalries between Sunni and Shiite Muslims tear apart much of the region — threatening to erase the borders of states like Syria and Iraq, destabilizing Bahrain and Lebanon, and accelerating a regional contest for power and influence between Shiite Iran and Sunni Saudi Arabia.

Scholars and activists say that the sectarian violence gripping the Middle East is not simply the unleashing of religious rivalries once suppressed by the secular autocrats who ruled the region. Instead, they say, the religious resentments have been revived and exploited in a very earthly power struggle.

“There are forces that keep the tension alive in order to get a bigger piece of the cake,” said Sheikh Maytham al-Salman, a Shiite Muslim scholar who was detained for nine months and tortured by the Bahraini police in 2011 because of his support for the uprising.

Pearl Square, where demonstrators staged a weekslong sit-in three years ago, has now been turned into a permanent military camp, its namesake statue demolished, in a grim memorial of the day in March 2011 when vehicles and troops from the neighboring Sunni monarchies rolled across the causeway from Saudi Arabia to crush the Shiite-dominated movement for democracy.

Once aroused, however, sectarian wrath can be unpredictable and hard to control, even boomeranging against those who might have sought to exploit it. From the first stirring of Arab Spring protest in Syria, for example, the government of President Bashar al-Assad and his Iranian backers sought to portray the movement as a sectarian power grab by certain Sunni extremists, in order to rally Christians and other religious minorities against it. Saudi Arabia and other Sunni-led Persian Gulf states sponsored satellite broadcasts firing up Sunni resentment of Shiite Iran and the Shiite-offshoot Alawite sect to which the Assads belong. And Sunni Arabs in Gulf monarchies funneled aid to the Sunni rebels as they grew increasingly violent.

Now, the Syrian revolt has fulfilled some of the worst sectarian fears — and threatened the security not only of the Assad family but also of Iran and Saudi Arabia. The most vicious Sunni extremists among the rebels, the Islamic State in Iraq and Syria, have seized a broad expanse of territory across both states and boasted of executing hundreds of Shiites and destroying their mosques.

Its rampage has brought it to the doorsteps of both the Iraqi government in Baghdad, an Iranian ally, and the Saudi Arabian monarchy, which has long feared such extremists as a threat to its own power at home.

Across the region, though, the resurgence of Sunni-Shiite sectarian hostilities has followed a pattern: The weakening of the old states leads anxious citizens to fall back on sectarian identity, while insecure rulers surround themselves with loyalists from their clans and denominations, systematically alienating others, often on sectarian lines. In the case of American allies like Bahrain and Iraq, analysts say, the United States and other Western powers turned a blind eye to the excesses and sectarianism of rulers they supported.

Hammering on those internal cracks, the region’s two geopolitical heavyweights, the Shiite theocracy in Iran and the Sunni monarchy in Saudi Arabia, have sought to protect their interests and influence by funneling support to clerics, satellite networks, political factions and armed groups squaring off along sectarian lines.

“Great powers gravitate to clients they can support,” said Vali Nasr, dean of the School of Advanced International Studies at Johns Hopkins University and a scholar of the region.

Saudi Arabia and Iran, he said, each employ a sectarian foreign policy to pursue classically secular objectives. “They play the game of great power politics and the chess pieces they choose inflame the sectarianism,” he said.

For the United States, the stakes include the stability of the region, the security of its allies and oil partners, and the risk that the regional power struggle might complicate attempts to broker a deal with Iran to limit its nuclear program.

But Washington has also confounded many in the region by maintaining alliances on both sides of the sectarian struggle, with Sunnis in Saudi Arabia, Bahrain and in the Syrian opposition, but with the Shiites in power in Baghdad. In Bahrain, the United States effectively assented as the Saudi military helped crush the largely peaceful uprising by the Shiite majority. In Iraq, rights groups say Washington stayed silent amid mounting evidence that Prime Minister Nuri Kamal al-Maliki was excluding the Sunni minority from power and condoning abuses against them.

Citing such conflicting entanglements, conspiracy theorists in the Arab media now often suggest that Washington may welcome the sectarian mayhem. “It is becoming the dominant narrative,” said Lina Khatib, director of the Carnegie Middle East Center in Beirut.

Secretary of State John Kerry recently flew to Baghdad to urge Iraq’s Shiite-led government to share power and eschew sectarianism, hoping that may relieve some of the resentment that has made part of the Sunni population receptive to the extremists.

In Bahrain, Shiite opposition leaders rolled their eyes. “We need to hear a similar message,” said Khalil al-Marzooq, a deputy chairman of Bahrain’s main Shiite opposition party, al-Wefaq, who was recently released from prison.

The split between Sunnis and Shiites began in the seventh century, after the death of the Prophet Muhammad. The dominant faction, which became Sunnis, argued that leadership should pass to Muhammad’s companion and father-in-law, Abu Baker. The faction that became Shiites argued for Muhammad’s cousin and son-in-law, Ali.

Today Shiites comprise only about 15 percent of the world’s 1.6 billion Muslims, although they form the majorities in Iran, Iraq, Bahrain and Azerbaijan and a plurality in Lebanon.

The theological differences are comparable to those dividing Catholics and Protestants, such as disagreements about the authority of clerics or the details of prayer rituals. Sunnis and Shiites have often lived together amicably and formed political alliances; intermarriage has been common.

But many Sunnis across the region still suggest Shiites are not true Muslims, while Shiites grumble of centuries of persecution.

In Iraq, the latest flash point, many polls conducted over the 11 years since the United States invasion consistently found that majorities of Sunnis and Shiites supported coexistence, describing their country as “mostly unified” instead of “mostly divided.”

But as Mr. Maliki has monopolized power and as rights abuses grew in recent years, national unity weakened. In a spring 2012 poll conducted by the Washington-based National Democratic Institute, the percentage of Iraqis who said it was a “mostly divided” country jumped by 12 percentage points from the previous year, to 35 percent. Among Sunni Arabs, the portion who called it “mostly divided” doubled from the previous year, to 58 percent.

In Bahrain, when thousands of demonstrators marched to Pearl Square in defiance of the government in February 2011, most were Shiites. But one of the most visible leaders was Ibrahim Sharif, a Sunni Muslim known as an activist against government corruption and as the general secretary of Bahrain’s main liberal party.

He was also one of the first leaders arrested, abducted from his home by the police in the first hours after midnight on March 17, just after police stormed Pearl Square. Mr. Sharif “broke their story” that the uprising was a Shiite plot, his wife, Farida Ghulam Ismail, said in an interview. He remains in jail on charges of treason.

By the time of his arrest and the crackdown, the mostly Shiite protesters had increasingly taken up Shiite chants, adding to the fears of Sunnis. Bahrain’s government accused its Shiite opponents of holding weapons, plotting the violent overthrow of the monarchy and taking leadership and support from the government of Iran.

Opposition leaders called the charges fear-mongering, but since then there have been signs of both growing violence and Iranian involvement. In December, the Bahraini authorities intercepted an Iraqi ship sailing toward the island with Syrian and Iranian weapons. A Shiite group calling itself the Ashtar Brigade has reportedly claimed responsibility for attacks on security forces, including a bombing that killed two Bahraini police officers and an officer from the United Arab Emirates. Another officer died Saturday after being wounded in what Bahraini officials called a terrorist attack.

Many in the Bahraini opposition parties now say their only hope is a regional peace involving both Saudi Arabia and Iran, which might alleviate the ruling family’s fears of any concession to the Shiite majority.

But optimists note that tensions in Bahrain have not yet escalated into communal violence between Sunni and Shiite civilians. Some opposition leaders argue that while Bahrain could become the next powder keg to explode, it still has a chance to become a model of power-sharing.

“Why wait until there is a real disaster?” asked Mr. Marzooq, of Wefaq, the main Shiite party.