Islamabad is under intense pressure from Washington, other western nations and Kabul to eliminate Taliban and Al-Qaeda havens in the tribal belt, from where fighters are said to stage attacks on foreign forces in Afghanistan.
But experts say Pakistan's desire to please the United States, a vital political and military ally, has run up against its own strategic interests in the region and its loyalty to Pashtuns, the predominant ethnicity among the Taliban.
"Pakistan's Taliban policy has suffered from indecisiveness, inconsistency and ambiguity," political analyst Hasan Askari told AFP.
"Pakistan's choices will become tougher in the future because its efforts to control the Taliban do not enjoy support throughout society. A good number of ordinary people see India as more of a threat than the Taliban."
The extremist Taliban movement emerged in the mid-1990s from Islamic schools along the Pakistan-Afghanistan border and -- with Islamabad's support -- eventually seized power in Kabul in 1996.
At the time, Pakistan's security establishment wanted a pro-Islamabad regime in Kabul that would give the country a foothold in Afghanistan, and much-needed strategic depth in the region to use against its nuclear-armed rival India.
President Pervez Musharraf disowned the regime following the September 11, 2001 attacks in the United States -- carried out by Al-Qaeda which was being harboured by the Taliban.
However, he allowed thousands of Taliban to enter his country's northwest tribal belt after their ouster in a US-led invasion in late 2001.
"Pakistan did not want to sever all of its links with the Taliban movement, as doing so would have Pakistan totally out of the regional power game in Afghanistan," defence analyst Riffat Hussain told AFP.
Fugitive Taliban leader Mullah Mohammad Omar is still widely believed to be hiding in the lawless tribal areas.
"Tens of thousands of Taliban poured into Pakistan's northwest and southwest but security forces were under strict orders only to arrest Al-Qaeda members," a senior security official with knowledge of counter-terrorism policy told AFP.
Hussain, head of strategic studies at Quaid-e-Azam University in Islamabad, said former military ruler Musharraf, who resigned last year, had two reasons for tolerating the militants' presence on Pakistani soil.
"Musharraf personally believed that there were many good Taliban who should be co-opted in the post-Taliban power dispensation in Afghanistan," Hussain said.
Islamabad also wanted an "insurance policy" against the US-backed government of Afghan Presideistani soil would have angered ethnic Pashtuns at home, saying: "Antagonising them completely is against our long-term national interest."
But putting up with the Taliban was a risky policy, and security officials say it has backfired, as the extremists formed alliances with other militant groups and started attacking Pakistani targets.
Those militant groups -- such as that of renegade warlord Baitullah Mehsud, believed to have masterminded the assassination of Pakistani former premier Benazir Bhutto -- are now allied with the Al-Qaeda network.
"For years Pakistan targeted Al-Qaeda and tolerated the Taliban, but this policy has failed and resulted in making the Taliban a strong force not just in Afghanistan, but in many parts of Pakistan," a top security official told AFP.
Musharraf's successor Asif Ali Zardari and Prime Minister Yousuf Raza Gilani now must review Pakistan's role in the US-led "war on terror," which may mean a rethink on the Taliban.
"Pakistan will be asked to become the anvil for the hammer of American special forces operations in the tribal areas," Hussain said, predicting that Islamabad could be asked to stage joint anti-militant operations with the US.
Askari agreed, but said Islamabad would ask Washington to put a stop to attacks on militant targets in the border zone by unmanned CIA aircraft because "they create credibility problems" for the Pakistani government.
"Pakistan faces a double challenge -- controlling the Taliban in the tribal areas and containing militant groups based in mainland Pakistan," Askari said.
"Unless there is a simultaneous development of internal stability in Afghanistan and Pakistan, the problem may not be addressed."
Follow Emirates 24|7 on Google News.