Foreign Office spokesperson Nafees Zakaria confirmed Thursday Pakistan’s participation in the Saudi-led Islamic coalition, saying the development took place after an agreement on terms of reference.

Zakaria in his weekly press briefing said he had no knowledge of contacts between the Saudi government and General (retired) Raheel Sharif, the head of the 39-nation military coalition against terrorism.

A retired army general claimed Wednesday Prime Minister Nawaz Sharif had agreed to Saudi Arabia’s request of appointing former army chief Raheel Sharif as the commander of the Muslim coalition hours before the news was made public.

 “Before his meeting with Raheel Sharif, the Saudi defence minister had requested PM Nawaz that the then army chief should be made the commander of the 39-nation Muslim coalition,” said Major General (retired) Ejaz Awan in a talk show.

“He (Nawaz Sharif) told Raheel Sharif that the kingdom ‘wants you to lead the Saudi-led alliance after retirement. I have made the commitment, I have said yes to them. You don’t say no,’’’ he added.

Awan said it was the prime minister himself who decided that Raheel Sharif will be sent to Saudi Arabia to lead the Riyadh-based Islamic coalition against terrorism.

Defence Minister Khawaja Asif said that Raheel Sharif's appointment had been finalised earlier in January.

A statement carried by Saudi state news agency SPA in December 2015 said the new coalition would have 34 members, though more have joined since then. It also said the coalition would be based in Riyadh to "coordinate and support military operations" against terrorism.

The states it listed as joining the new coalition included Egypt, Qatar, the United Arab Emirates, Turkey, Malaysia, Pakistan and several African nations.

It did not include Iran and its allies Syria and Iraq, leading to speculation that it could become a potential Sunni bloc against Iran, a rival of Sunni Saudi Arabia for influence across the Arab world. Tehran and Riyadh are ranged on opposite sides in proxy conflicts in Syria and Yemen.

Raheel Sharif retired last November, the first Pakistani army chief in more than 20 years not to seek an extension to his term like some previous military leaders.

Border management with Afghanistan

Zakaria said Pakistan and Afghanistan had to rely on institutional and cooperative mechanism in order to combat cross-border terrorism.

“We are availing all opportunities to engage with each other for addressing the issues of concern.

“There, however, is a need for effective border management between Pakistan and Afghanistan to combat the common threat of terrorism which affects people of both the countries.”

Pakistan has begun building a fence on its disputed 2,500 km (1,500 mile) border with Afghanistan to prevent incursions by militants.

Islamabad earlier this month temporarily shut the main crossing points along the colonial-era Durand Line border, drawn up in 1893 and rejected by Afghanistan.

Chief of Army Staff General Qamar Javed Bajwa said initial fencing will focus on "high threat zones" of Bajaur and Mohmand agencies in the Federally Administered Tribal Areas (Fata), which border eastern Afghan provinces of Nangarhar and Kunar.

"Additional technical surveillance means are also being deployed along the border besides regular air surveillance," the military said in a statement over the weekend, citing Bajwa.

Relations between Kabul and Islamabad have been tense in recent years, with both countries accusing each other of not doing enough to tackle the Taliban militants.

Bajwa said Pakistan was working on plans to "evolve a bilateral security mechanism" with Afghanistan.

"A better managed, secure and peaceful border is in mutual interest of both brotherly countries who have given phenomenal sacrifices in war against terrorism," Bajwa added.

In 2007, the military said it was fencing and mining a 35km (22 miles) stretch of border in Fata to prevent militants crisscrossing the rugged terrain.