Two weeks ago, a month and a half after retiring as Pakistan’s chief of army staff, Raheel Sharif was offered the position of director of the Saudi-led Islamic Military Alliance to Fight Terrorism (IMAFT), a proposed coalition of 39 countries that will have its headquarters in Riyadh. No newly-retired army chief of a country had, till then, accepted such a position at the invitation of another country. This, a priori, reveals the deep affinities between the Saudis and (some) Pakistanis. But such an appraisal needs to be qualified.

Historically, South Asian Muslims have inherited a rich legacy from the Persian civilisation and Sufi traditions. The poet Muhammad Iqbal did place the Arabian homeland, Hijaz, at the centre of his poetry when he wrote, for instance, “What does it matter if my wine jar is Persian? At least the wine is Arabian (Hijazi). What matters if the song is Indian (Hindi)? The tune, after all, is Arabian (Hijazi).” But in the presidential address to the 25th session of the Muslim League at Allahabad on December 29, 1930, he presented the project of a separate homeland for Indian Muslims as an opportunity for Islam “to rid itself of Arab Imperialism”. In his book The Reconstruction of Religious Thought in Islam, Iqbal acknowledged the importance of Abd al-Wahhab but he described his movement as conservative.

The founders of Pakistan not only ignored Saudi Arabia, but they thought that their country — the first Islamic Republic — would become the leader of the Muslim world. In December 1946, Jinnah toured the Middle East for promoting the idea of Pakistan. In Egypt, he held talks about the setting up of a worldwide Islamic League — an idea that was also discussed in India by Saint John Philby, the adviser of King Abd al-Aziz Ibn Saud. As president of the Muslim League, Chaudhry Khaliquzzaman argued in 1949 that “Pakistan would bring all Muslim countries together into Islamistan — a pan-Islamic entity”. In 1942, he had declared that “Pakistan is only the jumping off ground. The time is not distant when the Muslim countries will have to stand in line with Pakistan”.

But Saudi Arabia resented the manner in which Pakistan joined hands with the US — the best friend of Israel — through its membership of the SEATO and CENTO. Riyadh initiated the Muslim World League and then the Organisation of Islamic Conference in the 1960s. The then-president of Pakistan, Ayub Khan, forged an alliance with Iran and Turkey. Soon after, however, in the wake of the 1971 war, Z.A. Bhutto made overtures to Saudi Arabia because he had felt somewhat let down by the US and China. Bhutto needed money to develop what was to be known as the “Islamic” bomb. In return, Pakistan sent officers and soldiers to Saudi Arabia — up to 20,000 Pakistani forces were stationed in Saudi Arabia.

This rapprochement was consolidated under General Zia-ul-Haq. His Islamisation policy (an emissary of Saudi King Faisal, Maruf Dualibi, “framed” the 1980 Zakat and Ushr Ordinance, for instance) and the anti -Soviet Jihad in Afghanistan helped Zia in consolidating ties with Saudi Arabia, which not only matched the American financial support to Pakistan, but also helped it to develop Islamist networks — from madrassas to jihadi groups such as Lashkar-e-Taiba and the Haqqani network. Saudis have continued to cultivate their constituency within Pakistan since then. As a result, they can rely on three kinds of friends within the country. They get the support of Islamists of different kinds — the Jamaat-e-Islami in the past and currently, the Deobandi and Ahl-e-Hadith groups, including Lashkar-e-Taiba, whose leader, Hafiz Saeed, was trained in Saudi Arabia. These groups, and a bunch of madrassas, benefit from funding by Saudi charities.

The Pakistani army has traditionally appreciated the security-related collaboration between Islamabad and Riyadh that has enabled “the country of the pure” to not only buy arms (Saudis are used to pay for the weapons of their allies), but also to sell arms; in 2016, Saudi Arabia was the largest importer of Pakistani arms. Some politicians are very close to Riyadh. Nawaz Sharif, who spent seven years of exile in Jeddah before returning to Pakistan in 2007, is a case in point. Not only did one of his daughters marry a grandson of the Saudi King Fahd, but Nawaz Sharif has also developed several businesses in Saudi Arabia — a country he visits very often, not just for pilgrimages.

Besides these links, there is another important connection between the two countries: The remittances that Pakistani labourers send from Saudi Arabia. In 2015-16, they represented almost six billion dollars, up by six per cent from the preceding fiscal year.

Yet, Pakistan does not systematically bow to Saudi Arabia. First, when the PPP is in office, the government is generally closer to Iran. In 2013, Asif Zardari — whom the Saudis considered as a Shia — even promoted the building of a gas pipeline between Iran and Pakistan. During his term, Saudis turned mostly to the Pakistani military because they looked at their interlocutors in the government as pro-Iran. Second, parts of Pakistani society resist the brand of Islam exported by the Wahabi networks. Sufi shrines continue to attract large crowds — especially at the time of urs — in spite of repeated attacks on prestigious dargahs. Even Deobandis have not totally abandoned the cult of saints. Third, the “good Islamists” of the Saudis are sometimes perceived as “bad islamists” by the Pakistani government. Saudi Arabia and Pakistan fight al-Qaeda and ISIS together, but cultivate “their” separate Islamists. Sunni militant groups are a case in point.

The Pakistani establishment — including the army — could only resent the support Saudis gave to Lashkar-e-Jhangvi, whose sectarian terrorism they tried to counter. Liberals and Shia politicians are still more vocal, even on the PML(N) side. In 2015, a Pakistani federal minister, Riaz Hussain Pirzada, accused the Saudis of destabilising the Muslim world by distributing money to promote Wahabism. Fourth, the Pakistani state — including the army — cannot, by siding with Saudi Arabia, afford to alienate Iran (a neighbour who may turn even more to India) and the local Shias, one-fifth of the population, when sectarian strife has resulted in thousands of casualties. This is why, in 2015, Pakistan refused to join the Saudi-led coalition fighting the Houthi rebels in Yemen.

Two years later, the fact that Raheel Sharif accepted the position of director of the Saudi-led IMAFT sends different signals. Pakistan’s Defence Minister, Khawaja Muhammed Asif, has immediately reacted by saying that his country would not commit to anything more than the protection of Saudi Arabia’s territorial integrity. He has reiterated that his government was not prepared to take part in the Yemen war and that Pakistan wanted to promote peace, not divisions within the ummah. Is Raheel Sharif’s new job a kind of compromise that enables the Pakistanis to show their goodwill and a compensation, of sorts, for not sending troops? Will, on the contrary, the “Saudi-arabisation” of the country go one step further and destabilise more a country already badly affected by sectarianism? The future will tell, but history shows that Pakistan may continue to oscillate between Iran and Saudi Arabia — and remain faithful to its separate cultural identity as well.

This article was originally published in the Indian Express.