Follow the latest updates on Afghanistan here
The country has been intricately linked to the conflict across the border and has given a home to millions of Afghan refugees.
Analysts said Pakistan's government was surprised by the speed and scale of the collapse of Afghan President Ashraf Ghani's government, much like the West was.
Pakistan now fears being left to pick up the pieces from increased militancy and another wave of refugees as western nations depart.
But its security establishment, which has long been accused of supporting the Taliban, has rejoiced at the downfall of Mr Ghani's government, because it wipes away the influence of Pakistan's arch rival India.
As Taliban fighters arrived in Kabul largely unopposed, Pakistan's Prime Minister Imran Khan gave a measured response.
Mr Khan, who caused outcry in Afghanistan in 2012 when he declared the Taliban were fighting a "holy war" justified by Islamic law, has called on the international community “to work together to ensure an inclusive political settlement for long-term peace".
“The ideal time to end the conflict through negotiations might have been when the US/Nato troops were at maximum military strength in Afghanistan," he said.
"Continuation of foreign military presence for a longer duration now would not have yielded a different outcome.”
But in a speech to unveil a new education curriculum, he also appeared to refer to events across the border as Afghans breaking “the shackles of slavery”.
Pakistan's Human Rights Minister Shireen Mazari was quick to denounce Mr Ghani and his vice president, Amrullah Saleh, who have repeatedly blamed Pakistan for the insurgency.
She said it was “truly tragic to see the long-suffering Afghan people abandoned" by the pair.
"Both scuttle into hiding. It doesn't really matter where they have disappeared or bolted to, what's important is the leadership abandoned their people in midst of crisis. Shameful," Ms Mazari said.
Security experts are concerned the Taliban's return to power will embolden militants and extremists in Pakistan.
The Taliban's victory was immediately seized on by Pakistan's hardliners. The Tahrik-e-Taliban (TTP), also known as the Pakistani Taliban, congratulated their Afghan counterparts on their “blessed victory”.
The TTP killed thousands of Pakistani troops and civilians in their own insurgency, before they were largely forced into Afghanistan.
The Taliban conquest was also welcomed by Pakistan's largest religious political party, Jamiat Ulema-e-Islam.
Asfandyar Mir, an expert on South-Asian security at Stanford University, said the return of the Taliban was a “major wild card” for politics in Pakistan.
“It's likely to inspire and embolden conservative religious constituencies across the board and Pakistani decision makers are waking up to that fact,” he said.
But the sight of the India-backed Afghan government being swept away helped to assuage many concerns, with members of the security establishment rejoicing that India's influence was collapsing, he said.
If the Taliban takeover triggers a civil war, or they reimpose draconian rules on social and moral conduct, a large number of Afghans are expected to again flee to Pakistan.
US government estimates drawn up before Kabul fell suggested as many as 300,000 people may try to cross into Pakistan.
Pakistan is also keen to avoid international blame for what has happened. Its Inter-Services Intelligence agency has long been accused of using the Taliban as a proxy to gain leverage in Afghanistan.
The amount of support given has been hotly contested, but the Taliban leadership has been given refuge in Pakistan for years, allowing the group to gain strength.
Their leadership has lived in cities such as Karachi and Quetta, while wounded fighters have been treated in Pakistani hospitals.
The Nato coalition often called on Pakistan to exert more pressure on the Taliban by arresting or expelling their leaders, or forcing them to negotiate.
Pakistan says its influence has been exaggerated and it has done everything it can to bring the group to the negotiating table.
“We know we are going to get blamed and it's totally unfair. No one did more to help America fight terrorism in this region and now they have left us to pick up the pieces," a senior official in Pakistan said.