Pakistan appears to be encouraging a detente with Kabul and Washington, launching a diplomatic offensive to ensure that it remains central to efforts to initiate peace talks with the Taliban.
After 2011, a disastrous year for Pakistan's image abroad following the discovery that Osama bin Laden lived for at least five years in a garrison city, Islamabad is now trying to seize back the initiative.
The country has been badly destabilised by the Afghan war. Taliban and Al-Qaeda militants who fled the 2001 US-led invasion crossed into Pakistan, where they regrouped and offshoots launched their own Pakistani insurgency.
But how serious is Pakistan about helping to cut a deal in Afghanistan? And if willing, does it have the ability to overcome domestic crises and the legacy of its own association with the Taliban to play an effective role?
"It's a conundrum that's going to take an enormous amount of statesmanship from the politicians, from the military, to resolve," Pakistani author and Afghan expert Ahmed Rashid told a literary festival in Karachi this weekend.
"And I've not seen that kind of statesmanship from the government," he added.
Officially, Pakistan says it will do anything required by the Afghan government to support an Afghan-led peace process. Quietly, many people are sceptical that Islamabad is sincere about wanting a power-sharing settlement.
This month, Pakistan's young, glamorous Foreign Minister Hina Rabbani Khar made a fence-mending visit to Kabul. Her charm reportedly helped to soften the impact of a leaked NATO report accusing Pakistan of sponsoring the Taliban.
Prime Minister Yousuf Raza Gilani, taking time out from the tense build-up to a possible indictment for contempt of court, went last week to Qatar, the host of nascent contacts between the Taliban and the Americans.
This Wednesday, President Asif Ali Zardari will host a three-way summit between Afghanistan, Iran and Pakistan in Islamabad -- all part of a wider Pakistani effort to come in from the cold in Washington and Kabul.
And there's no mistaking signs of positive overtures to the United States, after the severely compromised relationship plunged deeper into trouble with US air strikes that killed 24 Pakistani soldiers on November 26.
Khar told reporters she expected Pakistan's more than two-month blockade on NATO supplies entering Afghanistan to end shortly after parliament approves a review of the US relationship in the first half of this month.
As soon as the review is over, probably before the end of the month, General James Mattis, the head of US Central Command, is expected to become the most senior US official to visit in months, a Pakistani security official said.
"There's a common understanding with the US that things have to improve," the official told AFP. "After things went down and down, we realised that we both need each other to stabilise the region."
The biggest fear, particularly among the Uzbek, Tajik and Hazara minorities in Afghanistan, is that Pakistan wants the Pashtun-dominated Taliban back in power, partly as a counterbalance to Indian influence in the region.
But since 2010, the official line calling for a "friendly Afghan government" has shifted to calling for a "stable and peaceful" solution.
"A Taliban government is not a reasonable perspective. This could trigger civil war, that would export (bad) ideologies in our country," said the security official.
Only a power-sharing peace agreement would establish "a government proportionately representative of the ethnicities", he said.
And Pakistan is ready to "carry messages" to the militant Haqqani network and Hezb-i-Islami warlord Gulbuddin Hekmatyar, who would be "more willing to accept peace" under a power-sharing agreement, he added.
Anatol Lieven, whose book "Pakistan: A Hard Country" was published last year, agrees that the Taliban are incapable of subjugating all Afghanistan and that Islamabad knows that. As a result, he believes, Pakistan is committed to a political solution.
Any eventual agreement, he predicted, would likely involve "a considerable level of decentralisation".
"The only question is whether we get it through a settlement or through years of bloody warfare," he told a think tank in Islamabad.
Some observers see the contacts in Qatar as a sign of Pakistan being isolated and of a desire by Taliban leaders, many of them refugees in Pakistan, to break free of Islamabad's influence.
But Pakistani writer and journalist Rahimullah Yusufzai, a specialist in the Afghan war, disagrees.
"Pakistan was in the loop. Pakistan wants to please the US as a mediator, and Pakistan has convinced some Taliban leaders to go to Qatar," he said.
Yusufzai said it was about building confidence with the Taliban, including via prisoner exchanges, easing sanctions and localised ceasefires, and a guarantee for Pakistan to counter-weight Indian influence in Afghanistan.
But beyond that he was pessimistic.
"Power-sharing with Taliban is very difficult."
Neither does the Pakistani security expect any breakthroughs soon, predicting "at least two or three years to get some results" from the putative dialogue. "Right now we're nowhere," he said.