Farooq Naeem, Getty Images
President Pervez Musharraf salutes people gathered for a farewell ceremony in Islamabad. His resignation ended nine turbulent years in power.

ISLAMABAD, Pakistan — The resignation of President Pervez Musharraf on Monday comes after months of belated recognition by U.S. officials that he was a waning asset. But it leaves them with a new elected government that is unwilling or incapable of confronting an insurgency determined to bring down the government.

Facing imminent impeachment charges, Musharraf announced that he would resign, ending nearly nine years as one of the United States' most important — and ultimately unreliable — allies in the campaign against terrorism.

The question of who will succeed Musharraf is certain to unleash wrangling between the two rival political parties who form the governing coalition and to add more turbulence to an already unstable nuclear-armed nation of 165 million people.

"We've said for years that Musharraf is our best bet, and my fear is that we are about to discover how true that was," one senior administration official said, acknowledging that the United States had stuck with Musharraf for too long and developed few other relationships to fall back on.

Bush administration officials will now have to deal with the fractious civilian government, which has so far shown scant interest in combating the Taliban and al-Qaida militants who have roosted in Pakistan's badlands along the border with Afghanistan.

After years in which Musharraf proved unable or unwilling to rein in militants in Pakistan, U.S. officials say they are now more skeptical than ever that they can count on cooperation from Pakistan's military leaders, including even Gen. Ashfaq Parvez Kayani, a former head of Pakistan's spy agency who replaced Musharraf as military chief last November.

Kayani has stressed to the Americans that his army is demoralized and weary. So far, he has declined to undertake the kind of counterinsurgency training for his soldiers that Washington believes is necessary.

The increasing U.S. mistrust of the Pakistani military, which has depended heavily on U.S. financial support, has been heightened by Kayani's reluctance to move more of the army's focus from the border with India to the tribal areas, he said.

A main challenge for Washington now will be to fix the attention of the two leaders of the coalition parties, Asif Ali Zardari and Nawaz Sharif, on the raging Taliban insurgency that not only threatens American soldiers in Afghanistan but also to destabilize Pakistan itself.

The campaign against the militants is unpopular here because it is seen as a U.S. conflict foisted on the country.