After the September 11 attacks, the United States gave Pakistan a harsh ultimatum to break with the Taliban. Pakistan offered help but insisted -- it will not be abandoned again, as in the 1990s after Washington lost interest in Afghanistan.
Twenty years later, the Taliban has retaken Afghanistan from a US-backed government -- and it looks likely that Pakistan will be abandoned again.
"Pakistan is too important to be permanently ignored by the US but this time Americans will take longer to determine the depth of their relationship with Pakistan," said Husain Haqqani, Pakistan's former ambassador to Washington.
The two-decade US war in Afghanistan has been accompanied by a turbulent relationship between the United States and Pakistan, whose then military ruler Pervez Musharraf vowed "unstinting support" after September 11.
Hoping to woo a skeptical Pakistani public, then senator John Kerry in 2009 spearheaded a civilian aid package that devoted $1.5 billion a year.
But US suspicions that Pakistan's powerful military and intelligence were playing a double-game came into stark relief when Osama bin Laden, the world's most wanted man, was found and killed by US commandos inside Pakistan in 2011.
The United States finally cut military aid in 2018 under president Donald Trump.
Haqqani, now a senior fellow at the Hudson Institute, said Pakistan sought credit for bringing the Taliban to the table with the Afghan government as part of the US withdrawal.
But in Washington, "what everyone remembers is what Americans see as Pakistan's role in allowing the Taliban to survive the blow the Americans inflicted on the Taliban after 9/11," Haqqani said.
While many Pakistanis feel "scapegoated," Haqqani said Pakistan's case was not helped by the "triumphalism" of Pakistanis including prime minister Imran Khan.
Khan said the Taliban have "broken the chains of slavery" while his climate minister in a since-deleted tweet hailed the Taliban's sweep as a "gift" to historic rival India.
- India lens -
Pakistan, a Cold War ally of the United States, worked with Washington in the 1980s to back Islamic guerrillas who fought out Soviet troops.
Afghanistan stayed mired in war as US interest waned and Pakistan openly backed the Taliban, who imposed a draconian version of Islam under their 1996-2001 regime.
Pakistan has long seen Afghanistan through the lens of India, which remembers how the Taliban welcomed virulently anti-Indian militants and has pumped in $3 billion in aid since 2001.
Madiha Afzal, a fellow at the Brookings Institution, said the Pakistani establishment nonetheless did not likely want a complete Taliban win.
"This sort of total military victory of the Taliban puts Pakistan in a position where it's probably less able to control the Taliban because the Taliban feels it's victorious," she said.
Islamabad privately also fears "terrible security implications" as Afghanistan could embolden Pakistan's Taliban in their own violent campaign, she said.
US President Joe Biden withdrew troops from Afghanistan arguing in part that the grinding conflict was a distraction from the greater challenge of a rising China.
Amid talk of a Cold War-style rivalry between the world's two largest economies, Islamabad has emerged as one of the closest allies of Beijing, which is investing heavily in an "economic corridor" in Pakistan at a time that Washington sees India as a leading partner.
Afzal said China will also be reliant on Pakistan's Taliban ties as it seeks to take advantage of Afghanistan's mining riches, such as lithium used in electric vehicles.
- Other ties limited -
Michael Kugelman, a South Asia expert at the Woodrow Wilson International Center for Scholars, said the United States could still decide Pakistan is the avenue to influence the Taliban or, if Islamabad agrees, to base counterterrorism operations.
If Washington "seeks engagement and wants to get Taliban assurances on issues of rights and governance, then the familiar pressure game will return" on Pakistan, Kugelman said.
Visiting Washington shortly before the Taliban takeover, Pakistan's national security advisor, Moeed Yusuf, called for a long-term relationship that looks beyond single issues.
But even though Pakistan has the world's fifth largest population, it was the 56th trading partner of the United States in 2019 at just $6.6 billion.
"The non-security relationship is not strong enough to make up for the lack of a security relationship," Haqqani said.
Afzal said that if the United States steps back, it "will just confirm Pakistan's existing notions that the US is only using Pakistan opportunistically when it needs it."
"If there isn't an abandonment and disengagement this time around, I think Pakistanis might take a step back and say, okay, something has changed," she said.
Ten million stories of migration to Britain