From multibillion-dollar military aid to stealthy and secretive drone strikes, Pakistan, perhaps even more than Afghanistan, has been the central focus of America's 12-year war on Islamist militancy.
Now, as President Obama's landmark policy speech on Thursday made clear, all of that is changing. Drone strikes are dwindling, the war in Afghanistan is drawing to a close and the battle against Al Qaeda is receding.
Pakistani leaders who have long demanded an American exit from their region may get their wish, but a broader disengagement is also likely to diminish the financing, prestige and political importance Pakistan held as a crucial player in global counterterrorism efforts, and could upset its internal stability.
The diminution of the drone campaign may ease a major point of friction between Pakistan and the West, but the tribal belt in northwestern Pakistan, where about 360 drone strikes have landed in the past decade, remains a hotbed of Islamist militancy, largely outside government control. Although many senior leaders of Al Qaeda sheltering there have been felled by C.I.A. missiles, they have been largely replaced by committed Pakistani jihadists with ties that span the border with Afghanistan.
With American combat troops leaving Afghanistan in 2014, and the drone campaign already winding down in Pakistan, analysts fear that unless the Pakistani Army can assert itself conclusively, the tribal region could be plunged into deeper chaos.
"It's going to be a lot of trouble," said Hasan Askari-Rizvi, a Pakistani academic and defense analyst. "If the insurgency increases in Afghanistan, it will spill into Pakistan's tribal areas, where the Taliban will become very confident."
For 12 years, the United States' security-driven policy has shaped power, politics and militancy in Pakistan.
After 2001, Gen. Pervez Musharraf, who came to power in a military coup, established himself as a steadfast ally of the West; it underwrote his authoritarian rule, which lasted until 2008. The military received almost $17 billion in American military aid, and transfers of American military hardware, solidifying its position as the dominant arm of the state.
That relationship has also fostered resentment, and some Pakistani leaders welcome an American disengagement.
They blame America's muscular presence -- expressed through troops in Afghanistan and espionage and drone operations in Pakistan -- for an Islamist surge that has killed tens of thousands of Pakistanis, and they argue that it has been a recruiting tool for militant groups like the Pakistani Taliban.
"Less American involvement is good, not bad," said Hina Rabbani Khar, who served as foreign minister in the last government, and who said she warmly welcomed the tone of Mr. Obama's speech on Thursday. "Drones help us lose the war. And the ideological space for these terrorists is the supposed U.S. occupation of Afghanistan. Once that excuse is not there, these people will have to face the music."
America's dogged pursuit of fugitives linked to Al Qaeda -- first in Pakistan's cities, later in the tribal belt along the Afghan border -- led to a two-faced policy toward Islamist militancy. Pakistani officials secretly accepted, and in some cases encouraged, the American drone program, while condemning it in public as a violation of sovereignty.
Similarly, under pressure from Washington, Pakistan helped the C.I.A. arrest some jihadists, while it quietly sheltered other armed militant groups, like the Afghan Taliban and Lashkar-e-Taiba, who were seen as furthering Pakistani interests in Afghanistan and India.
The American presence also created a giant blind spot in Pakistan's political psyche: with so much focus on American operations, Pakistani leaders used the United States as a scapegoat to avoid tackling some homegrown problems. Lurid tales of American espionage and other skulduggery abounded in the news media, promoted by politicians and mullahs but also fanned by real-life controversies like the shooting of two Pakistanis by the C.I.A. contractor Raymond Davis in January 2011.
Now that calculus is shifting for Pakistani policy makers. From now on, they will be less able to rely on the cloak-and-dagger workings of the drone program to have it both ways. Indeed, many fear a replay of the early 1990s when, after the departure of Soviet troops from Afghanistan, the United States withdrew abruptly, leaving behind a cadre of fired-up Islamist fighters, and then imposed sanctions on Pakistan for its nuclear weapons program.
Behind the bellicose speech, there is a complex dependency on both sides. While Pakistan's powerful generals have grown to resent the United States, they also lean on American military aid as a steady source of income in an economy so shaky it may soon require a bailout from the International Monetary Fund. The generals also rely on transfers of American military hardware to keep their fleet of F-16 fighters in the air.
General Musharraf, the former president, recently admitted that he had secretly authorized American drone strikes in the tribal belt in the early days of the campaign, from 2004. Four years later, Pakistani officials quietly helped the United States assassinate Baitullah Mehsud, the leader of the Pakistani Taliban, in a missile attack.
"I don't care if they do it as long as they get the right people," Yousaf Raza Gilani, then prime minister, told American officials in 2008, according to an American cable published by WikiLeaks in 2010.
Among the wider Pakistani public, though, the drones stoked anger, particularly over the issue of civilian casualties -- a factor acknowledged by Mr. Obama last week. At the same time, the C.I.A.'s success in assassinating senior Qaeda figures in the tribal region reduced the number of available targets.
Recently, as concern over drones mounted in the United States, the number of strikes in Pakistan dropped sharply, from about 130 at their peak in 2010, to just 12 so far this year. Civilian deaths also fell sharply, as the United States cut back on so-called signature strikes against clusters of militant suspects, which had caused the most casualties.
Now, Mr. Obama announced Thursday, American drones will attack only militants who pose an imminent threat to the United States, virtually ruling out strikes against the Pakistani Taliban, whose stated goal is the creation of an Islamist caliphate in Pakistan.
Still, the shift signaled good news for Nawaz Sharif, the prime minister-designate, who has vowed to make Pakistan less dependent on the United States. A scaled-back drone campaign will, at the very least, be one less issue to argue over.
It will, however, continue to exist, even if greatly diminished.
"This doesn't change much for Pakistan," insists Ahmed Rashid, author of several books on militancy in the region. "The fact that the campaign will remain under the C.I.A., surrounded in secrecy, is quite depressing for Pakistanis."
The central factor now, experts say, is the American withdrawal from Afghanistan next year. The United States will seek a smooth exit from the conflict; Pakistan will seek to retain influence in its western neighbor, while ensuring the flow of money and military assistance from the West.
As ever, the relationship is shaped more by threats than possibilities, a stark contrast with Washington's trade-based relations with Pakistan's traditional rival, India.
Still, few doubt that America will remain deeply involved in Pakistan, a country with a growing population of more than 180 million people, a network of seemingly indefatigable jihadi groups and a stockpile of over 100 nuclear warheads.
The question now is how Washington will pursue those enemies, and what level of cooperation it will enjoy from its Pakistani allies. "The Pakistanis look to the U.S. for financial and other support; the Americans are pursuing senior Al Qaeda," said Shamila N. Chaudhary, a former Obama administration official, now with the Eurasia Group, a Washington-based risk consultancy.
"Even after 2014, that mutual dependency will not go away," she said.
Eric Schmitt contributed reporting from Washington.
This article originally appeared in The New York Times.