It was an unusual meeting: An Iraqi Shia Muslim cleric openly hostile to the United States sat in a palace sipping juice at the invitation of the Crown Prince of Saudi Arabia, the Sunni kingdom that is Washington's main ally in the Middle East.
For all the implausibility, the motivations for the July 30 gathering in Jeddah between Moqtada al-Sadr and Crown Prince Mohammed bin Salman run deep, and centre on a shared interest in countering Iranian influence in Iraq.
For Sadr, who has a large following among the poor in Baghdad and southern Iraqi cities, it was part of efforts to bolster his Arab and nationalist image ahead of elections where he faces Shia rivals close to Iran.
For the newly elevated heir to the throne of conservative Saudi Arabia, the meeting – and talks with Iraqi Prime Minister Haider al-Abadi in June – is an attempt to build alliances with Iraqi Shia leaders in order to roll back Iranian influence.
"Sadr's visit to Saudi Arabia is a bold shift of his policy to deliver a message to regional, influential Sunni states that not all Shia groups carry the label 'Made in Iran'," said Baghdad-based analyst Ahmed Younis.
This policy has assumed greater prominence now that Daesh has been driven back in northern Iraq, giving politicians time to focus on domestic issues ahead of provincial council elections in September and a parliamentary vote next year.
"This is both a tactical and strategic move by Sadr. He wants to play the Saudis off against the Iranians, shake down both sides for money and diplomatic cover," said Ali Khedery, who was a special assistant to five US ambassadors in Iraq.
Ultimately, Sadr seeks a leadership role in Iraq that would allow him to shape events without becoming embroiled in daily administration, which could erode his popularity, diplomats and analysts say.
Such a role – religious guide and political kingmaker – would fit with the patriarchal status the Sadr religious dynasty has for many Shia Arabs in Iraq, Lebanon, Kuwait and Bahrain.
Days after the Jeddah meeting, Sadr met Sheikh Mohammed bin Zayed al-Nahayan, Crown Prince of Abu Dhabi, who has also taken an assertive line against Tehran, the dominant foreign power in Iraq since the 2003 US invasion ended Sunni minority rule.
Iran has since increased its regional influence, with its forces and allied militias spearheading the fight against Daesh in Iraq and Syria and holding sway in Baghdad.
For Saudi Arabia, which sees itself as the bastion of Sunni Islam, less Iranian influence in Iraq would be a big win in a rivalry that underpins conflict across the Middle East.
"There are plans to secure peace and reject sectarianism in the region," Sadr told the Saudi-owned Asharq al-Awsat newspaper last week, saying that it was "necessary to bring Iraq back into the Arab fold".
When asked what Saudi Arabia hoped to achieve with Sadr's recent visit to the Kingdom and the UAE, a Saudi official at the Saudi embassy in Washington said: "Saudi Arabia hopes to encourage Iraqis to work together to build a strong resilient and independent state. With that in mind, it will reach out to any party who could contribute to achieving that goal."
Washington supports the Saudi-Iraq rapprochement, but the embracing of Sadr raises questions about whether it sees a man known for his anti-Americanism as a reliable figure.
"It is perhaps close to a necessary evil," a US official said of the visit, although he said it was a "very uncomfortable position for us to be in" due to Sadr's anti-Americanism, which had led to the deaths of US citizens.
In-depth: Saudi Arabia in Iraq… What has changed?
"His visits to the region, and broadly the high-profile visits by Iraq, those things broadly are good, in that they get Iraq facing the Gulf nations and they help to turn their attention away from Iran," the official said.
A second US official said that Washington viewed the visits positively, "not because we're Sadr fans but because we've been pushing Saudi Arabia to mend fences and open gates with Iraq".
A politician close to Sadr said the Jeddah meeting was aimed at building confidence and toning down sectarian rhetoric between the two countries.
The rapprochement is "a careful testing of the waters with the Abadi government and some of the Shia centres of influence like Sadr and the interior minister," said Ali Shihabi, executive director of the Washington-based Arabia Foundation.
How far detente can go is unclear: Iran has huge political, military and economic influence in Iraq. Saudi Arabia is playing catch-up, having reopened an embassy in Baghdad only in 2015 after a 25-year break caused by the Iraqi invasion of Kuwait.
Sadr speaks to Saudi paper on Iraq and the ME: "Qatar will concede eventually, we're all Arabs, and Saudi is a father to us all." (Arabic) https://t.co/jyv23Uhri0
— Ihsan (@Thawra_city) August 11, 2017
Whatever the Saudis and Gulf states do, "Iran will stay the key player in Iraq for at least the next 10 years," said Wathiq al-Hashimi, chairman of the Iraqi Group for Strategic Studies think-tank.
Khedery said Saudi Arabia and the other Gulf states were not skilled at exerting external influence.
"They usually just throw money at issues and the beneficiaries of that largesse become very, very wealthy and that's it," he said. The Iranians in Iraq offered intelligence, diplomatic support and cash and wielded "big sticks" against anyone stepping out of line, he said.
Still, the Jeddah meeting has produced practical results.
Sadr's office said there was an agreement to study investment in Shia regions of southern Iraq. Riyadh will also consider opening a consulate in Iraq's holy Shia city of Najaf, Sadr's base.
Saudi Arabia would donate $10 million to help Iraqis displaced by the war on Daesh in Iraq, Sadr said, while Iraq's oil minister said Riyadh had discussed building hospitals in Basra and Baghdad.
After the Saudi trip, Sadr again urged the Iraqi government to dismantle the Tehran-backed Shia paramilitary groups involved in the fight against Daesh – a theme that is expected to become a top election issue.
A source from Sadr's armed group told Reuters that after the visit orders were issued to remove anti-Saudi banners from its headquarters, vehicles and streets.
Sadr had called on the Saudis to "stop hostile speeches by fanatical hardline clerics who describe Shias as infidels," and Crown Prince Mohammed had promised efforts towards this, the politician close to Sadr said.
It remains to be seen how far Saudi Arabia can prevent anti-Shia outbursts by its media or on social media, since Wahhabism, the kingdom's official ultra-conservative Sunni Muslim school, regards Shi'ism as heretical.
But the Saudi minister of state for Gulf affairs, Thamer al-Subhan, called for tolerance after greeting Sadr, using Twitter to decry "Sunni extremism and Shia extremism".
Saudi Arabia this week cracked down on Twitter users, including a radical Sunni cleric who published insulting comments about Shias.
As part of the wider detente, Iraq and Saudi Arabia announced last month they are setting up a council to upgrade strategic relations.
The Saudi cabinet has approved a joint trade commission to look at investment while a Saudi daily reported the countries planned to reopen a border crossing shut for more than 25 years – a point raised by Sadr on his visit.
Brett McGurk, US special envoy for the coalition against Daesh , tweeted earlier on Wednesday that he had visited the Iraq-Saudi border: "Closed since '90. ISIS [Daesh] attacked in '15. Today: secure, re-open, bustling w/1200 pilgrims per day."
Visited Iraq-Saudi border at Ar'Ar today. Closed since '90. ISIS attacked in '15. Today: secure, re-open, bustling w/1200 pilgrims per day. pic.twitter.com/WJMPn0Wc9n
— Brett McGurk (@brett_mcgurk) August 16, 2017
Another sign of rapprochement is an agreement to increase direct flights to a daily basis. Iraqi Airways hopes to reopen offices in Saudi airports to help Iraqis travel to the kingdom, especially for pilgrimages, Iraq's transport ministry said.
Then there is coordination on energy policy.
As OPEC producers, the two cooperated in November to support oil prices. Their energy ministers discussed bilateral cooperation and investment last week.
Iranian reaction to the meetings has been minimal.
"Iraqi personalities and officials do not need our permission to travel outside of Iraq or to report to us," foreign ministry spokesman Bahram Qasemi said last week, according to the semi-official Fars news agency.
The views expressed in this article belong to the author and do not necessarily reflect the editorial policy of Middle East Monitor.