ISLAMABAD, Pakistan - A successful army offensive, a shift in public opinion against the militants and the killing of top Taliban leaders have given grounds for cautious optimism in Pakistan as progress across the border in Afghanistan appears stalled amid spiraling violence and postelection turmoil.
The Obama administration has made it clear it sees victory in the fight against Islamist extremism as dependent on successes in both South Asian nations. Forging a common strategy for "AfPak," as the region is now dubbed in Washington, is a key priority.
Five months ago, nuclear-armed Pakistan was seen by some as on the verge of collapse, with U.S. Secretary of State Hillary Clinton saying the country was "abdicating" to the Taliban as the movement spread from its stronghold close to the Afghan border to the northwest Swat Valley and beyond.
To the relief of the West, the army moved forcefully against the Swat militants in April in a campaign that thrived with public support. Last month, the head of the Pakistani Taliban was killed in a U.S. missile strike, and questions remain whether its new leader will be able to maintain the group's ability to launch large-scale terrorist attacks.
Still, no one is saying overall victory is in sight. In particular, the tribal region of Waziristan remains an al-Qaida and Taliban haven despite past army efforts to clear it. On Friday, a suicide bomber plowed his explosives-laden vehicle into a hotel in the northwestern town of Kohat, killing more than 30 and wounding dozens of others.
"Clearly there are victories but there are still a lot of Taliban and there are still a lot of battles to come," said Kamran Bokhari, Middle East and South Asia director for U.S.-based global intelligence company Stratfor. "But for now the government still has the upper hand."
The signs of progress come as Pakistani leader Asif Ali Zardari prepares for talks on Thursday with President Barack Obama and British Prime Minister Gordon Brown in New York on how international donors can best support the country's democratically elected government.
Ishtiaq Ahmad, professor of international relations at Quaid-i-Azam University in Islamabad, said the public opinion shift against the Taliban combined with the political consensus on tackling the threat were "major factors for visible improvement in security" in the country.
Deadly attacks on major urban centres like the massive truck bombing on the Marriott hotel in Islamabad a year ago and the commando-style assault against the Sri Lankan cricket team in Lahore in March have decreased since the Swat Valley offensive, though near-daily violence has continued elsewhere.
Bokhari says the Tehrik-i-Taliban Pakistan has been left in disarray after the clearing of insurgents from the valley and surrounding areas in July, as well as the Aug. 5 killing of its leader, Baitullah Mehsud, in a CIA missile strike.
Further successes include the reported deaths of the al-Qaida operations chief in Pakistan and a top Uzbek militant in U.S. drone strikes in the northwest earlier this month, and the killing of 10 Taliban fighters attempting to infiltrate Swat's main city Mingora on Thursday.
Improved intelligence-sharing and co-ordination among Pakistan, the U.S. and Afghanistan have aided the effort, Bokhari said.
While the Pakistani military has at least temporarily gained the upper hand, the security situation in neighbouring Afghanistan has deteriorated with increased roadside bombings, suicide attacks and ambushes. Heightened counterinsurgency efforts by the U.S., NATO and the Afghan government have so far failed to make much headway there, analysts said.
Bokhari said while "the Pakistanis have gotten their act together," efforts in Afghanistan by the U.S., NATO and the Afghan government appear "to be in disarray."
Political turmoil in Afghanistan after the Aug. 20 presidential election amid allegations of vote-fraud is also clouding perceptions of the future there. While the government in Pakistan is unpopular, the political scene has been relatively stable since Zardari became president a year ago, allowing it to concentrate on counterinsurgency operations.
Imtiaz Gul, chairman of the independent Center for Research and Security Studies in Islamabad, wrote in Foreign Policy magazine last week "it's time for cautious optimism" for Pakistan, noting the interception of dozens of suicide bombers in the northwest and a drop in attacks elsewhere.
Bokhari said the uncertainty in strategy and cold feet among allies in Afghanistan has emboldened the Taliban there, and it remains unclear if the raging insurgency can be put down even with the deployment of more U.S. forces, which is now being considered in Washington.
"Even if you have all the troops you need, is it still a battle that can be won? Ultimately history has shown that Afghanistan - because of its geography and demography - is not something you can impose a military solution on," Bokhari said.
Associated Press writer Asif Shahzad contributed to this report.