In a move that surprised many analysts, Moqtada al-Sadr — a controversial Iraqi Shiite cleric and political leader — visited Riyadh, Saudi Arabia, late last month. This followed a season of marked improvement in relations between Baghdad and Riyadh over the past year, which allowed for a measure of guarded optimism toward the future of Iraqi diplomacy among some Iraq-watchers.

Several diplomatic visits had taken place between the two countries in recent months. In February, Adel al-Jubeir, Saudi Arabia’s minister of foreign affairs, visited Iraq. In June, Iraqi Prime Minister Haider al-Abadi visited Riyadh, followed by Iraqi Interior Minister Qassim al-Araji a month later.

Saudi Arabia’s new Crown Prince, Mohammed bin Salman, hosted Moqtada al-Sadr on July 30, leading to much speculation about how the visit fits into Iraqi politics, regional sectarian competition and — above all — Saudi-Iranian rivalry.

Though previously known as a “firebrand cleric” with a Shiite populist and militant line in Iraq, Sadr today presents himself as a moderate, nationalistic champion of change. His visit to Saudi Arabia was likely designed with two audiences in mind.

A message to Iraq’s Shiite population

Sadr’s visit was a message to his competitors in Iraq’s increasingly fragmented Shiite political scene. The Riyadh visit and the fact that Sadr was hosted at the highest levels of the Saudi establishment will underline his international relevance and burnish his prestige and credentials as an Iraqi statesman. This kind of political plumage is especially useful as Sadr and his rivals jockey for position ahead of next year’s Iraqi elections.

A message to Iran

Sadr’s visit demonstrated to Iran — and to Iran’s allies and proxies in Iraq/Sadr’s political rivals — that he not only has options, but he can even push back against Iran and has the power to potentially hurt Iranian interests in Iraq. If nothing else, this enables Sadr to present himself as the face of Arab (non-Iranian) Iraqi Shiism.

This is a position that resonates with his base — although the extent to which they will accept a Saudi embrace remains to be seen — and further differentiates him from his competitors. Having already announced a political alliance with Ayad Allawi, an anti-Shiite-Islamist figure, this visit will further polish Sadr’s credentials as a nationalist political figure who can rise above the politics of sect and ethnicity.

More importantly, the implicit threat contained in the visit is that Sadr could theoretically deliver his base — the most organic and genuinely grass-roots following in Iraqi politics — to Saudi Arabia, giving the Saudis an Iraqi opening they could only have dreamed of until now.

However, it is likely that neither Sadr nor Iran would want to burn bridges to the other just yet. At this point, it is more likely that Sadr is posturing with an aim to deriving maximum advantage from both Iran and Saudi Arabia rather than signaling a “Sadrist farewell to Tehran,” as some reports have suggested.

What’s in it for Saudi Arabia?

The first question to consider is: What kind of Iraq does Saudi Arabia want? Is Riyadh seeking an ally, a client — or are they seeking to destabilize Iraq? The latter scenario fits into the idea that Riyadh hosted Sadr as part of a strategy to destabilize Iraq and roll back Iranian influence by encouraging a Shiite-Shiite civil war.

The other two scenarios point to Saudi Arabia reviving its long, and so far futile, quest for effective Iraqi partners. After 14 years, Riyadh may well have given up on Iraq’s Sunni political classes — who have been disappointing even by the appalling standards of post-2003 Iraqi politics — and is now doing what it might have done back in 2003. Namely, trying to extend their interests within the new Iraqi order rather than supporting those who have so ineffectively tried to undermine that order. In such a scenario, there are few candidates better placed for the role than Sadr.

For Riyadh to get the most out of a relationship with Sadr, the Saudis will have to moderate their expectations and, more to the point, understand Sadr’s position and mentality. Riyadh will be sorely disappointed if it is expecting a pliable and subservient client in Sadr.

If the Saudis are able to moderate their expectations and better understand Sadr on his own terms, then they may get the opportunity to capitalize on the deep resentment felt by significant sections of Shiite society toward Iranian interference and influence in their country. However, this needs to be anchored in the tangible day-to-day realities of Iraqi-Iranian interactions that have given rise to anti-Iranian resentment rather than the abstract hysterics that tend to characterize Saudi Arabian — and broader Middle Eastern — views toward Iran.

New footing for Iraqi-Saudi Arabian relations?

Intra-Shiite political competition in Iraq has reached a point at which it no longer makes sense to speak of a singular Shiite bloc. This potential foothold in Iraqi Shiite politics would be a major coup for Saudi Arabia, particularly given the organic and genuinely grass-roots nature of Sadr’s support.

For his part, Sadr has consistently championed an Iraq-first stance ideologically, socially and politically. Both Riyadh and Sadr want to limit Iran’s influence in Iraq, and both see Iran and Tehran’s allies in Iraq as a threat. Herein lies the convergence of interests that can potentially form the basis for a new footing for Iraqi-Saudi Arabian relations and a recalibration of the three-way relationship between Iraq, Iran and Saudi Arabia.

However, the odds do not favor a benign outcome, and the challenges are too many to comprehensively list. How will Sadr react when his political rivals eventually (even if implicitly) question his Shiite-populist credentials? And how would Saudi Arabia’s conservative Sunni fundamentalist religious classes react to Riyadh doing business with a turbaned Shiite cleric?

The optics do not make for an easy sell on either side, and there will be plenty of forces in both countries and in the broader region that will want to see any move toward an improvement in Iraqi-Saudi relations thwarted. On the other hand, an attempt at Iraqi-Saudi rapprochement is being pushed at the highest level in both countries. One can only hope that whatever goodwill generated thus far will prove resilient in the face of the mounting challenges ahead.

Fanar Haddad is a senior research fellow at the Middle East Institute, National University of Singapore.