Pakistan’s prime minister Nawaz Sharif and army chief Gen. Raheel Sharif visited Riyadh and Tehran earlier this week in a bid to ease tensions between Iran and Saudi Arabia. The move is unusual in many ways, including in the choreography of the often competitive media offices of the prime minister and the army chief, which have emphasized the civil-military unity animating the trip.

Atmospherics aside, there is debate as to what sparked the visit of Pakistan’s top two power brokers and whether they can actually help bring down the temperature in the simmering Persian Gulf.

Pakistani officials, speaking on the condition of anonymity, are cautious in their assessments of their ability to facilitate Iran-Saudi Arabia dialogue. But they do see glimmers of hope.

Within the Pakistani leadership, there appears to be a broad consensus that reaching out to both Riyadh and Tehran was a matter of urgency—and not because of an imminent threat to Pakistan, which is more secure than it has been for a decade, but out of fears of a tailspinning Middle East and the externalities of sectarian conflict and civil war.

A Mission to Save the Region

While GEO News, Pakistan’s top news channel, reported that Pakistan was requested by Saudi Arabia to play the role of interlocutor with Iran, most sources indicate that the Pakistani initiative is unilateral and has been mulled over the past month.

The need for Iran-Saudi rapprochement was seen with greater urgency by Pakistani power brokers after a flurry of regional developments. In just the last few months Riyadh announced the creation of a thirty-four-member Islamic anti-terror coalition, the Shi’a cleric Shaykh Nimr al-Nimr was executed by Saudi Arabia, the Saudi embassy was subsequently attacked in Tehran, and the United States and European Union lifted major nuclear-related sanctions on Iran.

Meanwhile, Pakistan has sought to make clear to domestic and foreign observers that it has not and will not take sides in the feud between the two Muslim countries. Islamabad was caught unawares by its inclusion in Riyadh’s anti-terror coalition—a coalition that Tehran is not part of and sees itself as its real target. Visits by Deputy Crown Minister Muhammad bin Salman and Foreign Minister Adel al-Jubeir in early January furthered speculation as to what Pakistan’s actual role is in the Iran-Saudi cold war, despite the government’s repeated pronouncements of non-alignment.

This uncertainty, first and foremost, has ramifications at home. Pakistan is a Sunni-majority country. But upwards of twenty percent of its population is Shia. Since 1979, Pakistan has been afflicted by Sunni-Shia sectarian conflict, fueled in part by Iran and Saudi Arabia. The threat of sectarian conflict endures, though sectarian violence has declined since 2013, alongside a precipitous drop in terrorism overall. Nonetheless, sectarian agitators are aplenty and have been active in recent weeks. Prominent Tehran-backed Shia groups have protested against the al-Nimr execution. And a Saudi-backed segment within Pakistan’s Sunni community has been supporting the execution of the Shia cleric.

In a sign of how sensitively Islamabad views the country’s sectarian divide, its electronic media regulatory authority reprimanded a talk show host for encouraging Pakistan to take Saudi Arabia’s side against Iran. It also issued guidelines on how to report on the Iran-Saudi tensions.

Pakistan’s leaders also felt it was imperative to unambiguously convey their collective stand on the regional divide to Iran and Saudi Arabia. Given the army’s powerful role in Pakistan, and its strategic autonomy even in times of civilian rule, foreign actors are often unclear as to whom exactly is in control. At times, foreign officials even attempt to leverage Pakistan’s civil-military divide: when they fail to get what they want from the civilians, they often turn to the military, and vice versa.

The recent Pakistani mission, however, is more than a messaging exercise. Both Pakistan’s civilian and military leadership, and a broad segment of its politicos and talking heads, view Iran-Saudi rapprochement as an urgent need. They fear a spillover of the sectarian conflict and a return to Pakistan being an Iran-Saudi Arabia battleground.

While a reigniting of sectarian tensions in Pakistan would not constitute an existential threat, it would jeopardize Pakistan’s efforts to consolidate counterinsurgency and counterterrorism gains made nationwide over the past two years.

Between Opportunity and Risk

Pakistan sees a mix of peril and promise in the Persian Gulf. It keenly desires peace and security for Saudi Arabia, a reliable and trusted ally whose stability directly impacts Pakistan’s. After all, Saudi Arabia is home to over two million Pakistani expatriates and is Pakistan’s single largest source of remittances . In times of difficulty, Saudi Arabia has come to Pakistan’s aid—for example, by providing oil on deferred payment when Islamabad was hit by U.S. sanctions after conducting nuclear tests in 1998. A severe, existential crisis in Saudi Arabia would shock the Pakistani economy and result in the potential loss of a strategic security partner. From the perspective of an ally, Islamabad sees Riyadh’s escalating conflict with Tehran as injurious to Saudi interests.

At the same time, Pakistan also views its bilateral relationship with Iran as ripe with potential. A Pakistani security official sees a real possibility to live as “good neighbors” with Iran. Islamabad has proposed a free trade agreement with Tehran and Pakistan’s business community is particularly bullish on the potential opening of trade after the lifting of major sanctions. The dismantling of the U.S.-EU energy sanctions regime now allows for Pakistan to complete its portion of the Iran-Pakistan gas pipeline.

Additionally, there has been talk of integrating Iran into the economic corridor connecting Pakistan’s Arabian Sea port of Gwadar to China’s Xinjiang region. While Iran is constructing a deep sea port nearby in Chabahar, it has stated on a number of occasions that it does not view its port project as a competitor to Pakistan’s.

Having renewed the peace process in Afghanistan and comprehensive dialogue with India, and significantly reduced terrorism at home, Pakistan aims for a quieter region integrated not by transnational terror networks, but international energy, infrastructure, and trade networks. Such a future requires Pakistan being on good terms with Iran.

Can Pakistan Make an Impact?

In a notional sense, Pakistani officials believe they are optimally positioned to facilitate Iran-Saudi Arabia dialogue should both countries feel the need to speak. While the credibility of the United States in Saudi Arabia is severely diminished as if late, and world opinion seems to be tilting in Iran’s favor, Islamabad sees itself as on good terms with both Riyadh and Tehran.

To be clear, Pakistan is not a neutral actor in the Persian Gulf. It is a strategic partner of Saudi Arabia—nearly 1,200 Pakistani troops are currently stationed in the kingdom. And relations with Iran but have been frosty until last year. Post-revolution Iran has been closer to India than Pakistan. And in the 1990s, Iran and Pakistan were on opposite sides of a proxy war in Afghanistan.

But Pakistani officials say Iran’s leaders are cognizant of the long-standing ties between Islamabad and Riyadh, and so their proximity to Saudi Arabia may not be a liability. In fact, it could be an asset as it confers credibility on the missives it would be carrying from Riyadh.

Also, Pakistan’s standing in Iran’s eyes might also be better than it has been in the past decade. One Pakistani security official states that Islamabad’s decision to not take part in the Saudi-led Yemen war last April seems to have earned trust with Tehran without irreparably damaging relations with Riyadh. Pakistan’s non-involvement in Yemen combat provided a “jolt” to relations with Saudi Arabia, according to a Pakistani diplomat, but it fell short of resulting in a major breakdown in relations.

Riyadh had taken Islamabad’s involvement as a given, especially with Prime Minister Sharif, whom it hosted in exile, in power. But the recent visits of both Deputy Crown Prince and Defense Minister Muhammad bin Salman and Foreign Minister Adel al-Jubeir are evidence of Riyadh’s desire and need to continue to partner with Islamabad.

Good Intentions Are Not Enough

During his visits to Riyadh and Tehran, Prime Minister Sharif recommended that Iran and Saudi Arabia appoint “focal persons” who could engage a Pakistani intermediary and address outstanding issues between the two countries. He also reportedly offered to host talks between Iran and Saudi Arabia.

But with evolving power dynamics in Riyadh and Tehran, an assertive deputy crown prince running the show in Riyadh for now, and an obstinate establishment in Tehran, trust in Pakistan is not enough to make Islamabad’s diplomatic bid work.

It is encouraging that neither Iran nor Saudi Arabia has backed out of the Syria peace talks in Vienna, and that the Iran’s Supreme Leader Khamenei has condemned the Saudi embassy attack. But the broader geopolitical context suggests that it will be difficult for Riyadh and Tehran to learn how to share space in the region along the lines of a Congress of Vienna for the greater Middle East. Saudi debt climbs as oil prices are at an eleven-year-low and Iran is set to fully reenter the market, which may further depress oil prices. What incentive is there for an ascendant Iran to make concessions to an apprehensive and troubled rival?

For Pakistan, the real victory may be at home. Tested many times over the past two years, it has successfully avoided becoming entangled in a conflict between its neighbor and a long-time ally without jeopardizing ties with both countries. And it has made clear to its own diverse Muslim population that it will not be party to the cold war between Shia Iran and Sunni Saudi Arabia.