THESE are unhappy times in the Middle East for relations between Islam’s two main branches, the majority Sunnis and minority Shias. The ugly sectarian undertones of the civil war in Syria, where the death toll may now have passed 100,000, are echoing far more widely than during Iraq’s similar tragedy a few years ago. Yet the bitter old schism may also provoke a quieter resurgence of common sense.

Bullet casings litter the empty tree-lined streets of Sidon, a Lebanese port city, after three days of fighting that left perhaps 35 dead. The clashes started on June 23rd when armed followers of Sheikh Ahmed Assir, a firebrand Sunni preacher of a Salafist bent who seeks supposedly to emulate the ways of the Prophet Muhammad, attacked a Lebanese army checkpoint. Government troops, backed—some said—by the more experienced guerrillas of Hizbullah, a Shia party-cum-militia, responded with a full-out assault on the preacher’s mosque. Mr Assir broadcast messages from inside, denouncing the army as Shia stooges and calling on Sunni soldiers to desert, before himself slipping to safety.

The incident alarmed the Lebanese, whose equal-sized Sunni and Shia minorities, each about a third of the country’s total, are balanced by a combination of other sects. But the most immediate effect of the fighting was evident in Egypt, where the increasingly fiery rhetoric of Sunni extremists has terrified the Egyptian Shias’ tiny community of less than 1%. Even so, few anticipated the ferocity of a mob’s attack, also on June 23rd, on a Shia prayer meeting in a crowded slum on the outskirts of Cairo. Rumours of unseemly Shia rituals, together with Mr Assir’s desperate calls for help in Sidon, prompted thousands of youths to converge on a modest flat, smash through its roof and smoke out the Shias inside with Molotov cocktails. The 66-year-old prayer leader and three of his followers were bludgeoned to death.

Most people in Sidon blame Syria’s war for setting off a chain-reaction of sectarian anger. Starting as an uprising that transcended sect, the Syrian conflict has taken on an increasingly sectarian hue thanks to the Sunni Gulf states’ support for the rebels and to the backing of Bashar Assad’s regime by Iran’s Shia leadership and—more relevant to Lebanon—by Hizbullah. “My neighbour’s wife is Shia, I trade with Shia, but things have changed since Hizbullah started killing Sunnis,” says Muhammad Safadi, a shopkeeper in Sidon. “I am not sectarian but I am against anyone attacking my sect.”

Salafist networks, looking to boost their followings and to please rich backers in the Gulf, have fanned the flames by portraying Syria in terms of holy war. Mr Assir, whose mother, oddly, is Shia, was marginal in Sidon before he started to rail on television against Mr Assad and Hizbullah. Shafi al-Ajami, a Kuwaiti Salafist who channels aid to Syrian rebels, has publicly condoned the torture of Hizbullah fighters. Egypt’s president, Muhammad Morsi, looked on in silence this month at a rally for Syria as Salafists blasted Shias as “rejectionists” and “filth”. For months, Salafist parties in the Cairo slum where the four Shias were murdered had plastered walls with posters warning of lurking Shia “enemies”.

The revival of sectarian tensions that go back 14 centuries to a dynastic dispute has been a slow process. The empowerment of historically downtrodden Shias was boosted in the 1980s by the triumph of Iran’s Shia clergy in the Islamic revolution of 1979 and made more contentious by Iran’s subsequent bitter rivalry with arch-Sunni Saudi Arabia. In 2004 King Abdullah of Jordan heightened suspicions of Shias as an Iranian fifth column by warning of a looming “Shia crescent” as the long-dominant Sunnis lost control of Iraq in the wake of its American-led invasion. During the Arab uprisings of 2011, embattled rulers in Bahrain and Yemen, as well as Syria, resorted to divide-and-rule tactics by pitting the sects against one another.

But clashes between Sunnis and Shias have been the exception rather than the rule. For all the resurgence of sectarian identity, many of the region’s Muslims, including many deeply religious ones, disdain the rising confrontation. More voices preaching sectarian harmony are being heard, too. Among many others in Egypt, the head of al-Azhar, Sunni Islam’s leading theological institution, issued a sharp rebuke to Salafists spewing sectarian bile.

Shia leaders such as Iraq’s Ayatollah Ali al-Sistani, who fret that their community could again become pariahs in the region, have in the past also sought to calm Sunni-Shia ire. The parliament in Kuwait, home to a sizeable Shia minority, earlier this month condemned attempts to use Syria to stir up sectarian feeling. Despite the recent return of tit-for-tat sectarian bombings in Iraq, Sunni and Shia parties in Baghdad last week formed a city government that excludes the party of the prime minister, Nuri al-Maliki, a Shia who has played on the country’s sectarian divisions. The backlash in Egypt against religious extremism has put yet more pressure on Mr Morsi’s increasingly beleaguered Islamist government.

Joost Hiltermann of the International Crisis Group, a Brussels-based think-tank, notes that neither the weight of religious allegiance nor the shape of political alliances has ever been constant in the Middle East. The knowledge that these are liable to change acts as a brake against all-out sectarian war, he says. As many Sunni Muslims in Sidon abhor Sheikh Assir as follow him, while Hizbullah counts Sunnis among its supporters. Qatar and Saudi Arabia both back Syria’s rebels, yet disagree over which faction to support. For his part Hassan Nasrallah, Hizbullah’s head, has called on Lebanese factions to fight in Syria, not at home.