WASHINGTON — Hours after the Sept. 11 attacks, Pakistan’s leaders were given an ultimatum by the Bush administration: Because the looming war in Afghanistan could not be won without Pakistan’s help, Islamabad would have to choose between continuing its alliance with the Taliban or joining forces with the United States.

Just shy of 10 years later, President Obama’s announcement on Wednesday night that he is beginning the long-anticipated withdrawal from Afghanistan marks another step in the gradual reversal of that calculus. Though the president could not say so directly, one of the constraints on America’s retreat from a hard and bloody decade is the recognition that, more than ever, the United States will be relying on Afghanistan’s help to deal with the threats emerging from Pakistan.

The administration argues that the killing of Osama bin Laden last month at his compound deep inside Pakistan, combined with scores of other counterterrorism strikes, have given it greater leeway to reduce its troop numbers in Afghanistan. Yet Pakistan’s angry reaction to that raid also makes it more urgent than ever that the United States maintain sites outside the country to launch drone and commando raids against the militant networks that remain in Pakistan, and to make sure that Pakistan’s fast-growing nuclear arsenal never falls into the wrong hands.

What the raid of the Bin Laden compound in Abbottabad, Pakistan, “demonstrated more vividly than ever is that we need a base to strike targets in Pakistan, and the geography is simple: You need to do that from Afghanistan,” said Bruce Reidel, a retired C.I.A. officer who conducted Mr. Obama’s first review of strategy in the region.