Pakistan's support for the Taliban goes back to the early 1990s when the militant group emerged from the ashes of the long Afghanistan war in the 1980s and the subsequent civil war following the exit of Soviet troops.
Many experts say that Pakistan's military establishment was instrumental in the Taliban's earliest battlefield successes and their eventual capture of Kabul in 1996. Pakistan was also one of the few countries in the world that swiftly recognized the Taliban's hardline regime in Afghanistan.
Experts say that there are several strategic reasons behind Islamabad's support for the Islamist group. Prior to the Taliban's emergence from the Islamic seminaries in northwestern Pakistan, and the Pashtun-speaking areas of Afghanistan, Islamabad had supported several groups to protect its interests in Kabul.
But other regional countries, including Russia and India, were also vying for control in Afghanistan. This regional tug-of-war over Afghanistan resulted in a deadly civil war that killed thousands of people.
Since the partition of British-India in 1947, Pakistan has always been wary of "unfriendly" regimes in Kabul. It started backing Islamist groups in Afghanistan against pro-communist parties and pro-India politicians, which culminated in a full-blown "jihad" in the 1980s with support from the United States.
Following the September 11, 2001 terrorist attacks, Pakistan was forced to put the brakes on supporting Islamist militants in Afghanistan.Under pressure from Washington, then Pakistani military dictator Pervez Musharraf joined the US-led war on terror against Al-Qaida and the Taliban, and backed the US invasion of Afghanistan to topple the Taliban regime.
Doha deal 'victory' for Pakistan
From the 2001 US invasion of Afghanistan to the recent signing of the US-Taliban agreement in Doha, western governments have blamed Islamabad for its alleged support to some factions of the Taliban and other Islamist groups.
The US urged Pakistan to "do more" against the Taliban to stop militant attacks on foreign troops stationed in Afghanistan. Security analysts say Pakistan acted "selectively" against the Taliban, knowing that the group could be used as a "bargaining chip" at a later stage in the Afghan war.
Experts say that the landmark Doha deal is a huge victory for Islamabad, as the Taliban, the militant group that Pakistan has always favored, is once again back in the driving seat.
"With Pakistan's support, the Taliban are stronger than ever — economically, militarily, politically, and also in their international standing. Pakistan obviously hopes that it can benefit from the remarkable re-emergence of the Taliban in Afghanistan," Siegfried O. Wolf, director of research at the Brussels-based South Asia Democratic Forum (SADF), told DW.
What is Pakistan's influence moving forward?
It is not surprising that Pakistan hailed the historic deal between the US and the Taliban in Doha on Saturday.
"The Pakistani military establishment assured Washington that they used their influence to make sure that the Pakistani Taliban would force the Afghan Taliban to agree to stop attacks on American forces in Afghanistan," said Ali K. Chishti, a Pakistani security analyst who is familiar with Islamabad's role in the peace process, told DW, adding that US President Donald Trump used his good ties with Pakistani Prime Minister Imran Khan to get the job done.
Read more: US-Taliban deal — a victory for Islamists?
Pakistani Foreign Minister Shah Mahmood Qureshi told DW on the sidelines of the Doha summit that his country only played the role of a facilitator in the US-Taliban deal.
"We have no favorites. We are willing to engage with everyone. We cannot be guarantors, we have only been facilitators. If invited to intra-Afghan talks, we will encourage the peace process to move forward as observers," Qureshi said.
However, South Asia expert Wolf said that Islamabad will now try to influence all further negotiations, including intra-Afghan dialogue but also the upcoming US-Taliban interactions.
"The US-Taliban deal stands on a shaky ground. The fact that Pakistan's Foreign Minister Qureshi called for a 'responsible withdrawal' of US forces from Afghanistan is a clear indication that Islamabad has already positioned itself in the upcoming discussion on the remaining US troop level in Afghanistan," Wolf said.
Within the first 135 days of the deal, the US committed to reduce its forces to 8,600 from the 13,000 currently stationed in Afghanistan. The agreement lays out a 14-month period for the withdrawal of "all military forces of the United States, its allies, and coalition partners, including all non-diplomatic civilian personnel, private security contractors, trainers, advisors, and supporting services personnel."
This significant reduction of American troops in Afghanistan will leave Afghan troops vulnerable to Taliban pressure. In the aftermath of the US troop drawdown, President Ashraf Ghani's government could be forced to make more compromises with the Taliban during an intra-Afghan dialogue.
A hindrance in Afghan peace?
The US-Taliban deal has already come under pressure, with Afghan President Ashraf Ghani refusing to release Taliban prisoners, and the insurgents resuming attacks on Afghan forces. On Wednesday, US forces province.said they carried out airstrikes in a "defensive attack" on the Taliban in Afghanistan's Helmand province.
This prompted Pakistani foreign minister Qureshi to urge Ghani that his government show "flexibility" in dealing with the insurgents. Qureshi said that Kabul needed to take the responsibility to create a "favorable environment" to facilitate intra-Afghan talks after the historic Doha deal.
Analysts say that Pakistan is perceived by the Afghan government as a hindrance in the peace process.
"Pakistan's goal in Afghanistan remains the same: not allowing a unified, strong and India-friendly Kabul," analyst Wolf said, adding that the post-presidential election frictions among Afghan's top politicians are going in Pakistan's favor.
"Foreign Minister Qureshi's attempt to push President Ghani to accept the prisoner swap and establish a 'favorable environment' for intra-Afghan dialogue indicates that Pakistan is not willing to accept a role on the sidelines," said Wolf.