Saudi Crown Prince Mohammed bin Salman may have got the cold shoulder from protesting crowds in Tunisia and been publicly sidelined at the G20 conference last November, but he was treated to a hero’s welcome in Pakistan this week.

It was more of a savior’s welcome, bearing in mind the financial lifeline he threw to Prime Minister Imran Khan. And that aid was part of a significant bargain struck between Islamabad and Riyadh.

>> China Is Now Pakistan's Partner in Jihadist Terror

Khan has acquiesced to MBS’ pointed demand: to join the Sunni Muslim axis against Iran. That formalization of an anti-Tehran alliance that Pakistan has previously hesitated to endorse will have ripple effects both within Pakistan, and across the region.

The first leg of Saudi Crown Prince Mohammad bin Salman’s Asia tour saw him strike $20 billion worth of deals in Pakistan. The financing comes as much needed relief for Islamabad, which is looking to dodge a thirteenth International Monetary Fund bailout amid a balance of payment crisis that is crippling the economy.

Open gallery view Saudi Arabia's Crown Prince Mohammed bin Salman, center, reviews guard of honour during a welcoming ceremony in Islamabad, Pakistan, Sunday, Feb. 17, 2019. Credit: ,AP

During the two day trip that culminated on Monday, MBS further provided diplomatic support to Islamabad at a tense period of relations with India due to last week’s bombing in Indian-administered Kashmir, which killed over 40 Indian security officials.

Just as India threatens war in retaliation, assurances Pakistan received from both Saudi Arabia and China bolstered its decision that there was no need to go after Jaish-e-Mohammad, the terror group that took responsibility, and whose leadership is still living openly inside Pakistan.

Where China has reiterated it has no plans to reconsider its veto on the move to designate JeM Chief Masood Azhar a terrorist by the United Nations, Saudi Arabia’s joint statement with Pakistan following MBS’s visit highlighted the need to "avoid politicization of the UN listing regime."

MBS’s financial and diplomatic support comes in exchange for Pakistan’s increased involvement in the so-called Islamic Counter Terrorism Military Coalition (IMCTC). Islamabad was informed about its new role by former Army Chief General (retired) Raheel Sharif – who now commands the IMCTC – in the lead up to the MBS visit.

The IMCTC was formed in December 2015, nine months into Saudi military campaign in Yemen. At the time Riyadh was planning the execution of influential Shia cleric Sheikh Nimr al-Nimr, which brought Saudi Arabia and Iran to a standoff, leading to a severing of diplomatic ties.

It also coincided with the peak of the Islamic State (ISIS)’s powers in Iraq and Syria, confident enough even to launch attacks in Saudi Arabia. That synchronicity gave the IMCTC cover as a military alliance designed to counter ISIS, disguising its counter-Iran aims, with the obvious feel-good factor of an unprecedented formation of Muslim states uniting to fight a group orchestrating Islamist terrorism across the world.

Three years later, however, ISIS has been largely eliminated in the Middle East, even before the IMCTC could become operational. And so the coalition, with a predominantly Sunni membership making it a mere extension of the "Arab NATO," needs a new cover for its actual goals of countering Iranian influence in the region.

The window of opportunity is narrow: Saudi Arabia must exploit the remaining lifetime of the Trump administration and its staunch anti-Iran posture, embodied by the U.S. pullout from the Iran nuclear deal, and the economic benefits of US-backed sanctions on Iranian oil.

Pakistan holds a key position in the Saudi plan. Not only is Pakistan’s military expertise critical for the sustenance of IMCTC, its location as Iran’s neighbor has geostrategic significance.

Where Saudi Arabia’s $10 billion oil refinery in the port city of Gwadar will provide the finance and energy lifeline to Pakistan, its location in Balochistan, bordering Iran, sparks obvious military apprehensions in Tehran.

To make Pakistan an integral part of its case against Tehran, MBS is also looking to paint as a potential victim of "Iranian terrorism." This was evident is Saudi State Minister for Foreign Affairs Adel bin Ahmed Al-Jubeir calling Iran the "world’s chief sponsor of terrorism" sitting next to the Pakistani Foreign Minister Shah Mehmood Qureshi in Islamabad on Monday.

That explicitly anti-Iran rhetoric is being voiced in Pakistan in the presence of the most senior Pakistani ministers and with their tacit sanction underlines that Islamabad has now formally aligned itself against Tehran.

Practically, however, this has been the case since Pakistan decided to join the IMCTC in 2016, and gave the green light for its former army chief to command it.

Open gallery view Iranian mourners gather around the coffins of Revolutionary Guards killed in a suicide attack blamed on 'Pakistan's security forces' at their funeral. Isfahan, Iran. February 16, 2019 Credit: AFP

Tehran has already reacted to the newly hostile tone. On Saturday, Tehran said Islamabad would "pay a high price" for last week’s attack on its Revolutionary Guards alleging that Pakistan provides safe havens to Jaish-al-Adl, the group which has regularly orchestrated attacks in Iran. Tehran has threatened retaliatory action in the past for what it considers deliberately lax border security.

Just as Islamabad gave MBS an anti-Iran podium, Tehran is echoing claims often made by India: that Pakistan provides a safe haven for to jihadists and fails to take action against militants crossing the border to launch attacks on neighboring territories. That identification with its arch-enemy naturally makes Pakistan’s alignment against Iran easier.

Popular opinion in Pakistan has not been overly enthusiastic to signing up the Saudi side in its Middle East conflicts. Three years ago, the National Assembly even adopted a resolution against the country’s military involvement in Yemen.

The fact that Pakistan is home to the second largest Shia population in the world has also been a concern for its rulers every time they’ve been asked to become party to Saudi foreign policy priorities.

There are more ramifications for the ruling party, Pakistan Tehrik-e-Insaf (PTI), which has a significant vote bank among the Shia community. The leadership of its main rival, the Pakistan Muslim League-Nawaz (PML-N) are widely considered to be Saudi shills, since Riyadh provided former Prime Minister Nawaz Sharif refuge in the aftermath of the 1999 military coup.

Open gallery view Morning newspapers with front-page-coverage of Saudi Arabian Crown Prince Mohammed bin Salman are pictured at a roadside stall in Islamabad on February 18, 2019. Credit: AFP

But the tide is turning. None of this discomfort was visible in the almost hagiographic coverage of MBS’s Pakistan trip, with the local media churning out panegyric supplements dedicated to the Saudi Crown Prince. Even the opposition leadership wholeheartedly welcomed MBS; there was a scramble to take credit for the deals signed with Saudi Arabia.

And unlike in Tunisia or the G20, neither the global outrage over the killing of journalist Jamal Khashoggi nor Saudi war crimes in Yemen were even whispered as concerns.

That’s less surprising. Given the country’s own disregard for them, there usually isn’t much outrage in Pakistan over human rights violations – unless Muslims are at the receiving end from a non-Muslim regime. Of course, there’s an exception for superpower allies: Pakistan has not commented on China’s persecution of Uighur Muslims in the Xinjiang region bordering Pakistan.

Indeed, Islamabad might be entering a prolonged era of enforced silence on the human rights abuses exercised by China and Saudi Arabia, with the two countries looking set to protect their investments in Pakistan by providing diplomatic support on the international stage.

Open gallery view Vehicles drive past a billboard displaying the portrait of Indian Prime Minister Narendra Modi and Saudi Arabian Crown Prince Mohammed bin Salman ahead of his official visit to India, Feb. 19, 2019. Credit: AFP

On the Saudi side, that back up won’t be entirely watertight. While China already considers India a major rival, Saudi Arabia won’t feel any compulsion to compromise its growing trade relations with India for the sake of pacifying Pakistan, and might even issue vague statements against cross-border terrorism for New Delhi’s consumption.

Pakistan is clearly relinquishing not inconsiderable control over its foreign policy and military resources, and reaffirming its diminished status as a client state of both superpowers. But Imran Khan’s government clearly assesses that’s a small price to pay for economic salvation and the gift of solid cover to continue to nourish jihadists as key geostrategic assets.

Pakistan has made itself significant enough to be bailed out by China and Saudi Arabia, both financially and diplomatically. Now Islamabad will be hoping it can play both powers to its advantage, and that Riyadh and Beijing cooperate for influence over Pakistan, rather than fighting a zero sum contest for exclusivity.

Kunwar Khuldune Shahid is a Pakistan-based journalist and a correspondent at The Diplomat. His work has been published in The Guardian, The Independent, Foreign Policy, Courrier International, New Statesman, The Telegraph , MIT Review, and Arab News among other publications. Twitter: @khuldune