FROM the forecourt of the Prophet Muhammad’s mosque in Medina during the annual haj pilgrimage, which ended on September 4th, came the still, small voice of Shias praying. Saudi security guards fanned them helpfully against the heat. At the al-Baqi cemetery nearby, the resting place of many of the Prophet’s descendants, Sunni vigilantes and puritans scowled at Shia worshippers but, in contrast with previous years, they held back from beating them with sticks. And as over 2.3m Muslims perambulated around Mecca’s great black basalt stone, the Kaaba, Prince Khalid al-Faisal, the province’s governor, singled out 86,000 Iranians for a special welcome.

Change may be afoot in Saudi Arabia’s hostile relations with Shias and their champion, Iran. For decades the kingdom has been the font of Sunni Islam’s anti-Shia dogma. The media issued screeds against the rawafidh, or rejectionists, deemed beyond the pale of proper Islam. But this year the oft-troubled haj was exceptional for its inclusiveness, and for passing off with no major incident despite a 20% jump in the number of pilgrims. Iran made a point of thanking the Saudis.

On ascending the throne in 2015, King Salman bin Abdelaziz and his young son and defence minister, Muhammad, set their sights on rolling back Iran’s influence from the region by force. They waged war on Iran’s Houthi allies in Yemen, who had seized control of Sana’a, the capital. They rejected demands for compensation for the hundreds of Iranian pilgrims killed in a stampede in Mecca in 2015. The following year they beheaded Nimr al-Nimr, a rowdy Saudi Shia cleric. They cut off diplomatic relations with Iran and spearheaded a grand military alliance of Sunni states. No more of the old “comatose”, consensual politics, said Saudi officials.

Two years on, Prince Muhammad, who since June has been crown prince, may be thinking anew. Rather than confront Iran’s various satellites, he is wooing them and their Shia rulers. He has renewed ties with Iraq that had been severed 25 years ago, this month reopening borders for people and goods for the first time since 1990. He sent his chief of staff to Baghdad to sign a deal on intelligence sharing, and brought Iraqi trade delegations to Riyadh, his capital. In June he hosted Iraq’s Shia prime minister, Haider al-Abadi. In July he sat smiling in Jeddah, Saudi Arabia’s commercial capital, with one of Iraq’s fieriest Shia clerics, Muqtada al-Sadr. “Sunni hardline and Shia hardline doesn’t build nations or societies,” tweeted one Saudi minister.

The kingdom plans to open a consulate in Najaf, the spiritual capital of Shia Islam in southern Iraq, and to lay on direct flights for thousands of Saudi Shias to visit its Imam Ali shrine. “Sectarianism has to wane,” says Adel al-Jubeir, the Saudi foreign minister. “The region is calming down.” He cites the winding down of the war in Syria, and the throttling of Islamic State’s jihadist “caliphate”.

Indeed, the Saudis have shifted on Syria, too. Saudi clerics used to urge on Sunni mujahideen against the supposedly heretical Alawite clan ruling Syria with their Iranian allies. Now they have toned it down, lest they be accused of abetting terrorism. Prince Muhammad is said to have stopped backing Syria’s Sunni rebels and urged their leaders in exile in Riyadh to compromise with President Bashar al-Assad’s ghastly regime.

The Saudis are still bombing northern Yemen. But there, too, they are sounding more conciliatory and keener to make a deal. Unusually, they apologised for an air-raid on Sana’a on August 25th which killed 14 civilians. A Saudi spokesman suggested reopening Sana’a’s airport and Yemen’s largest port, Hodeida, under UN auspices.

Some Saudi officials say they want to woo back Iran’s Arab allies, putting ethnicity above religion, in order to push back Iranian influence. “The more you engage with Iraqis, the less the Iranians will come,” says one. “Iraq belongs to the Arab world.”

Some observers foresee a rapprochement between Saudi Arabia and Iran, talking of a grand bargain whereby the Saudis might recognise Iran’s pre-eminence in the north of the Middle East, including Syria, in exchange for a Saudi free hand in the Gulf states and the Arabian peninsula.

But Mr Jubeir dismisses such talk as “laughable”. “When you hear honeyed words from [President Hassan] Rouhani’s government [in Iran], we see the aggressive actions of its Revolutionary Guard,” says a Saudi official, alleging Iranian-inspired terrorist plots in Kuwait and Bahrain and lamenting Iran’s meddling in Yemen.

Any progress will be difficult. The kingdom is wary of being seen to appease Iran. For Shia-dominated Iraq’s leaders to embrace the Saudis will not be easy either. Mr Sadr was lambasted at home for meeting Prince Muhammad, just when Saudi forces were levelling Awamiya, a Shia town in eastern Saudi Arabia outraged by Mr Nimr’s execution. Some Saudis, for their part, were aghast when the prince congratulated Mr Abadi for defeating Islamic State in Mosul—and clobbering the old part of one of Sunni Islam’s greatest and most beautiful cities.