Saudi Crown Prince Mohammad bin Salman’s four-day visit to Pakistan, set to begin this Saturday, is meant to reaffirm the importance of the two countries’ strategic partnership. However, it is also an indicator of the kingdom’s growing concern about expanding ties, most especially in energy cooperation, between Pakistan and archrival Iran. While the kingdom understands Pakistan’s need to balance its relationship with both nations, the crown prince is hoping that Pakistan’s dire financial situation and reliance on Saudi largesse will prevent Islamabad from moving too close to Tehran.

Pakistan is a long-standing Saudi ally. Military and intelligence ties between the two countries are deeply rooted and date back to the early 1980s. For Pakistan, Saudi Arabia is an economic lifeline. Although bilateral trade between the two countries is small—just $3 billion in 2017—the kingdom hosts 1.9 million Pakistani residents and four hundred Pakistani companies. Pakistani workers in Saudi Arabia are the leading source of remittances for the Pakistani economy (Pakistani remittances from the United Kingdom and the United States rank second and third, respectively). In 2017 alone, remittances made up 6.5 percent of Pakistan’s GDP. In addition, Saudi Arabia has gifted or lent Pakistan billions of dollars in aid, foreign direct investment, and oil.

Geopolitically speaking, however, Pakistan is in a tight spot. Archfoe India lies to the east and south. To the north, Afghanistan remains unstable, and relations between the Afghan government and Pakistan are comparatively chilly given the former’s long-standing relationship with the Taliban. Making matters worse, New Delhi has sought to deepen this divide by making diplomatic and economic overtures to Kabul. This leaves Iran to its west. While Iranian-Pakistani relations remained cool for many years because of the former’s support for the Taliban, they began to warm again after the 9/11 attacks. In particular, the two nations have a mutual interest in putting down Baluchi separatists along their shared border. Given this reality, Saudi Arabia understands Islamabad’s need to maintain cooperative ties with the Islamic Republic.

Recent developments have, however, led some in Riyadh to believe that Pakistan’s neutral posture is at risk. In 2017, Qamar Bajwa became the first Pakistani army chief of staff to visit Tehran in an official capacity in twenty years, rankling the kingdom over the prospect of enhanced Iranian-Pakistani military ties. Iran has also made social and cultural inroads, financing hundreds of Pakistani mosques and seminaries and dozens of universities. Moreover, Pakistani Prime Minister Imran Khan and his allies have actively courted their country’s Shi’a—who make up between 10 and 20 percent of the population and feature prominently in the military’s officer corps—by forging political ties with Iran-friendly groups, publicly stating that Pakistan, which has experienced bouts of sectarian violence, will not become a battleground for a Saudi-Iranian proxy war, and voicing concern about the Saudi-led campaign against Yemen’s Shi’a Houthi rebels.

But the kingdom is perhaps most worried about Iran’s interest in joining the China–Pakistan Economic Corridor through the construction of the Iran–Pakistan (IP) natural gas pipeline. When complete, the IP pipeline will allow Iran to export approximately seven hundred fifty million cubic meters of natural gas per day—approximately one-quarter of Pakistan’s anticipated needs by 2022–23—to Gwadar Port, strategically situated in southwest Pakistan. From there, the gas will be distributed domestically or exported abroad via a planned liquefied natural gas (LNG) terminal. While the pipeline will certainly prove an economic boon to Pakistan, it gives Tehran—which can shut off the gas if it so chooses—direct leverage over Islamabad. It will also help Iran to forge closer ties with Beijing, which financed, developed, and runs Gwadar Port and is putting up most of the money for the construction of a second pipeline that would pump gas from Gwadar to Nawabshah (in the center of the country).

While Saudi Arabia cannot stop the IP pipeline, its economic clout far surpasses that of Iran. Pakistan, which is in dire financial straits and is seeking to secure $12 billion in loans, knows this. And while Islamabad has petitioned the International Monetary Fund (IMF) for help, it also knows that any prospective agreement will come with politically unpalatable conditions. Accordingly, the kingdom has boosted Islamabad’s negotiating position with the IMF by giving Pakistan $3 billion in cash and an additional $3 billion in deferred loans for oil imports. Pakistani officials also anticipate the crown prince announcing as much as $20 billion worth of new projects and investments. This figure will include approximately $10 billion for the construction of a Saudi oil refinery at Gwadar, potentially checking further Iranian energy inroads into the port region. Furthermore, the kingdom has expressed an interest in purchasing two LNG power plants in Punjab province. Procuring these plants, which currently rely on Qatari gas, would give Riyadh direct, albeit limited, leverage over Pakistan’s LNG sector.

Finally, it is important to note that immediately after he concludes his trip to Pakistan, the crown prince will travel to India. There he is expected to announce several new trade and investment deals, a not so subtle suggestion that Saudi Arabia can also pursue a “neutral” posture between two foes if it chooses.