WASHINGTON, Oct. 20 — The scenes of carnage in Pakistan this week conjured what one senior administration official on Friday called “the nightmare scenario” for President Bush’s last 15 months in office: Political meltdown in the one country where Al Qaeda, the Taliban, and nuclear weapons are all in play.

White House officials insisted in interviews that they had confidence that their longtime ally, Gen. Pervez Musharraf, Pakistan’s president, would maintain enough influence to keep the country stable as he edged toward a power-sharing agreement with his main rival, Benazir Bhutto.

But other current and former officials cautioned that six years after the United States forced General Musharraf to choose sides in the days after the Sept. 11 attacks, American leverage over Pakistan is now limited. And General Musharraf is weakened.

His effort at conciliation in Pakistan’s tribal areas, where Al Qaeda and the Taliban plot and train, proved a failure. His efforts to take them on militarily have so far proved ineffective and politically costly. Almost every major terror attack since 9/11 has been traced back to Pakistani territory, leading many who work in intelligence to believe that Pakistan, not Iraq, is the place Mr. Bush should consider the “central front” in the battle against terrorism. It was also the source of the greatest leakage of nuclear arms technology in modern times.