Two years ago, Pakistan President Pervez Musharraf won good standing with European nations and the US for abandoning Afghanistan's Taliban in the wake of the Sept. 11 attacks on the US.
Now his country stands accused of going back on its word and flirting with remnants of the fundamentalist regime it helped bring to power.
Washington and Kabul say Musharraf's government is not doing enough to stop Taliban remnants regrouping in Pakistan and crossing the border to launch guerrilla attacks in Afghanistan.
More seriously, some critics accuse elements in Pakistan of actively encouraging the Taliban.
"We are playing with fire," said leading Pakistani journalist and author Ahmed Rashid. "Afghanistan, after Iraq, is a focus of international attention. It is not a country you can mess around with and no one will notice."
Furious about growing Indian influence in Afghanistan, and the marginalization of its traditional Pashtun allies, the theory goes that Islamabad is using the Taliban for leverage.
From US special envoy Zalmay Khalilzad to Afghan President Hamid Karzai, the message is clear: Pakistan must do more to crack down on the Taliban and arrest Taliban leaders thought to be planning attacks from inside Pakistan.
Kabul says hardline Islamic parties and local government officials in Pakistan are actively supporting the Taliban, perhaps along with "rogue elements" from Pakistan's powerful military intelligence.
Islamabad denies the charge -- Interior Minister Faisal Saleh Hayat is resolute that his government will come down hard on any hint of a Taliban resurgence on Pakistani soil.
A tough challenge
In Pakistan's rugged tribal areas, where al-Qaeda chief Osama bin Laden might even be hiding, separating fact from fiction is no easy task. But two facts are not in question, diplomats say.
The first is that hundreds of Taliban militants, often well armed and well equipped, are crossing back and forth across the 2,450km border and attacking Afghan targets.
The second is that stopping them is not easy. Even the mighty US army cannot seem to prevent the militants slipping through their hands, melting into the civilian population or disappearing over remote mountain passes.
"Pakistan has unnecessarily taken this task on itself," said former intelligence chief Hamid Gul. "It is not possible to seal the border, and if Pakistan fails all the blame will come on us."
Newspaper editor Najam Sethi says Islamabad is framing its Afghan policy through the prism of its bitter rivalry with India.
When India was allowed to open consulates last year in the Afghan cities of Jalalabad and Kandahar, close to the Pakistani border, alarm bells rang in Islamabad.
Letting the Taliban cause trouble is one way for Islamabad to exert pressure on Kabul, and make sure power is shared more equally with Afghan Pashtuns.
"Pakistan is very alarmed and very worried that the Indians have got a foothold in Afghanistan," said Sethi.