LONDON - Ahead of his election last July, Pakistani Prime Minister Imran Khan’s rhetoric regarding the Middle East seemed overtly pro-Iranian to many in the Gulf Cooperation Council, despite Pakistan’s history of friendly ties with Gulf countries.

In 2015, Khan and his Pakistan Tehreek-e-Insaf (PTI) party supported the Iran nuclear agreement, which many in the Gulf saw as empowering Tehran to further its destabilising regional agenda.

Khan and the PTI were driving forces in the Pakistani parliament to reject joining the Saudi-led Arab coalition in Yemen in 2015, viewed by many analysts as a proxy war between Saudi Arabia and the United Arab Emirates on one side and Iran on the other.

“On going in for US-Saudi alliance to fight in Yemen: Has Pakistan not suffered enough by participating in others’ wars?” Khan said on Twitter in March 2015.

With elections a few years later and with political and economic motivations in mind, Iranian officials felt that the time to strengthen relations with Islamabad was ripe.

In terms of economic motivations and considering renewed sanctions tied to the US withdrawal from the Iran nuclear deal, Tehran was hoping that Khan’s election might revive the Iran-Pakistan gas pipeline project, which has been in the making since 1995.

The project, which includes a 2,800km natural gas pipeline, has been plagued with setbacks. Iranian officials blamed the United States and Gulf Arab countries for Pakistan’s lack of commitment in finishing its part of the plan.

Politically, because of Khan’s parliamentary stances and public statements, Iran felt that a shift in relations was at hand. It appeared Tehran was aggressively courting Khan with Iranian Foreign Minister Mohammad Javad Zarif, who was first foreign official to visit the new prime minister.

“The fact that Pakistan’s relations with the United States have been experiencing some difficulties has increased Tehran’s hopes that Islamabad might turn away from Washington and its regional allies — notably Saudi Arabia but also the UAE — and strike closer relations with Tehran,” Shireen Hunter, a research professor at Georgetown University’s School of Foreign Service, wrote in September.

However, it appears that long-standing relations, economic realities and the responsibilities of leading a country trumped Khan’s populist views.

In September, media reports claiming that Khan would make his first official overseas trip to Iran were proven false; he opted to visit Riyadh instead. The motivations are plentiful. A report from Thomson Reuters said Pakistan is “facing an economic crisis due to depleting foreign reserves and a widening current account deficit” since Khan took office in August.

The Khan government would either have to work with the International Monetary Fund for a bailout, which would impose austerity measures further devaluating the rupee, results that often lead to public unrest, or seek financial help elsewhere.

In October, Riyadh allocated $3 billion in foreign currency support for up to a year to help Pakistan’s balance-of-payments predicament. Saudi Arabia also agreed to a 1-year deferred payment facility of up to $3 billion on oil imports.

The Gulf Arab support did not end there. During an official visit January 6 to Islamabad, UAE Crown Prince Sheikh Mohammed bin Zayed al-Nahyan said Pakistan would be receiving a $3 billion loan package and $3.2 billion in oil imports on deferred payment.

Saudi Crown Prince Mohammed bin Salman bin Abdulaziz is expected to visit Pakistan in February, with speculation in the Pakistani media pointing towards further local investments, including finalising a memorandum of understanding to establish a petrochemical complex in Pakistan.

Analysts said the support comes with a caveat, with some diplomatic payback likely.

“It’s unlikely a $6 billion gift would come with no strings attached,” Michael Kugelman, deputy director of the Asia Programme at the Wilson Centre in Washington, told Voice of America.

“I imagine in all likelihood Islamabad had to reassert its allegiance to KSA [the Kingdom of Saudi Arabia] with the implication that Pakistan should back away from the Imran Khan government’s strong assertion of neutrality in the Iran-Saudi Arabia rivalry.”

As far as Tehran is concerned, it appears that the damage is done. An editorial last November in Iran’s Mehr News Agency described Khan as being subservient to Riyadh, saying: “Speculation had been put to rest. Khan was walking in the footsteps of his predecessor.”