Pakistan has traditionally maintained that its bilateral relationship with the Kingdom of Saudi Arabia is its “most important diplomatic relationship.” Developments in Saudi Arabia last week appear to have hinged to a significant degree on the close relationship that the Kingdom shares with the Pakistani military.

Besides both being members of the Organization of Islamic Cooperation (OIC), the two have long maintained a strong military relationship. Pakistani military personnel frequently serve in Saudi Arabia and its last army chief, General Raheel Sharif, now heads a 41-nation Islamic army coalition based out of Riyadh. Sharif’s accession was seen as Islamabad picking sides with Saudi Arabia against Iran.

On October 26, the Pakistani Army concluded Al-Saman 6, a three-week military exercise with the Saudi Royal Land Forces. Drills included use of live ammunition, ambushing, combat patrolling and special training on how to deal with IEDs, under commanding officer Lieutenant General Akram Al Haq from the 30th Corps of the Pakistani Army. Pakistan has also been keen to sell arms to Saudi Arabia and has enjoyed Saudi support while developing its nuclear weapons program.

On October 16, Pakistan Army Chief Gen Qamar Javed Bajwa met with Saudi Crown Prince Mohammed bin Salman, the man behind the purge against senior Saudi members of the royal family, on the sidelines of an ‘anti-terror’ conference organized by the Saudi Defense Ministry in Riyadh. General Bajwa also visited Tehran on November 6, and, according to reliable diplomatic sources, discussed cooperation on missile technology and the visit of Iranian scientists to SUPARCO, Pakistan’s official space agency. That visit was seen as a move to assuage Iranian concerns over Pakistan’s deep involvement with the Saudis.

The meeting with Crown Prince Salman came a little over two months after General Bajwa hosted Saudi Deputy Defense Minister Mohammad Bin Abdullah Al-Aysh in Rawalpindi, where Saudi domestic security was discussed in detail. “Of course, there was no hunch of the arrests and the political upheaval that we’ve seen over the past week or so back then, but in recent months there has been a clear urgency in Riyadh with regards to Pakistan’s involvement in its security,” a senior military official told Asia Times on condition of strict anonymity.

Riyadh has been actively pursuing Islamabad’s military resources on two counts: its own territorial integrity, and Pakistan’s participation in the Islamic Military Alliance against Terrorism (IMAT), the aforementioned organization commanded by General Sharif.

“Even if the Pakistani troops aren’t physically involved in an attack on Iran – or in Yemen, Qatar or Lebanon – the fact that we are bolstering Saudi defense domestically naturally makes us an integral part of their camp”

General Sharif had been rumored to be on the verge of quitting the IMAT on the grounds that Riyadh’s demand for ‘Sunni only’ military personnel was “sectarian.” However, these rumors were quashed when he told the Middle East Military Alliance and Coordination Conference last month that it was an “honor for him to be part of Saudi-led Islamic Military Alliance as a commander.”

Pakistani officials are at pains to describe General Sharif’s involvement as not being a reflection of Pakistan’s foreign policy. “General Raheel Sharif is leading the IMAT in his private capacity. His decisions do not reflect the official Pakistani policy – although one can understand why any of his actions can be construed as such, and we’re sure he’s perfectly aware of that,” a senior government official told Asia Times. “In any case, [General Sharif] has said on record that he won’t participate in any exercise designed against a specific country, and wants to lead a unified fight against the likes of ISIS.”

Lieutenant General Talat Masood, a former secretary of Pakistan’s Ministry of Defense Production, told Asia Times, meanwhile, that “Sharif is functioning ‘independent of Pakistan’ and is focused on better equipping” the Saudi troops. “He is currently helping improve capabilities of the Saudi armed forces that would eventually be a part of the IMAT. He isn’t commanding the Pakistani troops that are deployed in the kingdom to defend Saudi territorial integrity and are contractually limited to Saudi domestic matters,” he said.

Military analyst Hassan Askari Rizvi, author of The Military and Politics in Pakistan, said Pakistani military involvement in Saudi Arabia is primarily for training purposes. “The Pakistan Army is providing a lot of support functions. This is because there are no professional forces in the region. With the exception of the Turkish Army, most of the armies in the Middle East are ceremonial. So in case of a conflict the Pakistan Army naturally takes center stage,” he told Asia Times.

While both civil and military officials maintain that Pakistan has conveyed its unflinching neutrality to Riyadh, vis-à-vis Iran, in reality Islamabad is treading a fine line. “Even if the Pakistani troops aren’t physically involved in an attack on Iran – or in Yemen, Qatar or Lebanon – the fact that we are bolstering Saudi defense domestically naturally makes us an integral part of their camp,” a retired Army officer told Asia Times. “When Pakistani troops are positioned to protect areas being shelled by Houthi rebels, they are technically guarding Saudi boundaries, but we’re also clearly picking our side in the conflict.”