The U.S.-Pakistan relationship has hit rough spots before, but the two sides have always patched things up — less out of affection than mutual necessity.
Pakistan coveted American funds and military equipment. The United States wanted a regional partner against terrorism, supply routes into Afghanistan and an eye on Pakistan's nuclear weapons.
Now President Trump is shaming Pakistan on Twitter and withholding hundreds of millions of dollars in security assistance at a time when the United States needs its difficult ally more than it has in years.
Supplying the growing war effort requires cooperation from Pakistan, which controls the roads into landlocked Afghanistan and has blocked U.S.-led NATO coalition vehicles during previous spats. The alternative route goes through Central Asia, is several times costlier and requires dealing with a nettlesome Russia, the regional power broker.
"If Trump wants to increase troop levels, I'm not sure he can engage in this back-and-forth with Pakistan," said Shamila N. Chaudhary, who served as Pakistan director on the National Security Council during the Obama administration. "They're going to need those routes."
U.S. officials also acknowledge that the troop surge won't be successful unless it forces the Taliban to begin talks with the Afghan government to reach a durable resolution to the war. Many experts believe that only Pakistan's powerful security establishment — which has sheltered Taliban leaders for more than a decade — can persuade the militant group to negotiate.
Pakistan's military has long maintained links to extremist groups, including the Taliban and the Haqqani network, that serve its strategic interests. Both groups have attacked U.S. and allied forces in Afghanistan, but the United States has often looked past that as it supplied Pakistan with $33 billion over the last 15 years.
After a series of tweets over the last week in which Trump railed against what he called Pakistan's "lies and deceit" and said the U.S. funding had been "for nothing," the State Department announced Thursday that the United States would freeze military aid until Pakistan "takes decisive action" against militant groups, including the Taliban and the Haqqani group.
In announcing the suspension, Trump administration officials were unusually bereft of details. They could not give the amounts of aid affected by the freeze nor say what military materiel would be cut.
State Department officials denied, however, that they had been rushed into the announcement to justify Trump's tweets. They said Secretary of State Rex Tillerson, Defense Secretary James N. Mattis and Gen. Joseph Votel, head of the U.S. Central Command that oversees military operations in Afghanistan and Iraq, had all raised concerns in visits to Islamabad in recent months.
"This has been an ongoing conversation, not only within the U.S. interagency, but with Pakistan … actually, over many, many years, and then specifically over the last couple of months," said a senior State Department official who briefed reporters on condition of anonymity.
U.S. officials say the administration also harbors concerns about the security of Pakistan's nuclear weapons program, the freedom with which militant anti-India groups such as Lashkar-e-Taiba and Jaish-e-Mohammed raise funds and operate in Pakistan, and the recent release from house arrest of Lashkar leader Hafiz Saeed, the subject of a $10-million U.S. bounty.
Pakistan called the decision counterproductive, but said it was "determined to continue to do all it takes to secure the lives of our citizens and broader stability in the region."
A statement from the Foreign Ministry touted Pakistan's role in fighting Al Qaeda and routing militants from its tribal regions along the Afghanistan border. Pakistani civilians have borne the brunt of their country's war on terrorism, with tens of thousands killed in extremist violence since 2001.
But Pakistan's military said Trump's decision would have repercussions.
"Suspension of security assistance will not affect Pakistan's resolve to fight terrorism; however, it for sure will have an impact on Pakistan-U.S. security cooperation and efforts towards regional peace," army spokesman Maj. Gen. Asif Ghafoor told Voice of America.
The United States has tried cutting aid or imposing conditions on Pakistan in the past. When it needed leverage against the Pakistani army, then-Sens. John F. Kerry and Richard G. Lugar wrote 2009 legislation that directed more aid to the weak civilian government. In 2016, the Obama administration withheld $300 million because of growing frustration over Pakistan's inability to rein in the Taliban.
Pakistan has lashed out too — most notably in 2011, after NATO airstrikes accidentally killed two dozen of its soldiers. Pakistan shut down Afghanistan supply lines for months until the United States issued a formal apology.
Despite the rhetoric, analysts said Pakistan would probably view the aid freeze as a negotiating tactic and not an end to the relationship.
"They will all bounce back from this," Chaudhary said. "No one can afford not to talk at all. Pakistan has nuclear weapons. You can't cut them out of the discussion on how to end the conflict in the region, when they are a party to the conflict."
Trump's announcement was the latest twist in a relationship that has ricocheted from warmth to disgust in the 14 months since he was elected president.
In November 2016, Trump showered praise on Pakistan in a phone call with then-Prime Minister Nawaz Sharif, saying he was "doing amazing work, which is visible in every way." Then, in August, he demanded it "change immediately" its policy of harboring militant groups and invited Pakistan's archenemy, India, to play a greater role in securing Afghanistan.
In October, after Pakistani forces helped rescue an American woman and her family from captivity by the Haqqani network, Trump said Pakistan was "starting to respect the United States again."
Ayesha Siddiqa, a Pakistani security analyst, said that NATO's continued use of Pakistani land and air supply lines would be the subject of future negotiations, and that officials were not panicking about the aid freeze.
"I don't think Trump's threat will matter," Siddiqa said. "The money, they knew, would dry up someday."
Pakistan has also been sanguine about its declining relationship with the United States because of growing ties with China, which is developing a giant portfolio of infrastructure projects worth $62 billion.
The State Department official said the United States had "no problem with Pakistan and China's relationship," but added that the suspension of aid should appeal to Pakistan's pride.
"What matters, I think, to the Pakistanis is the symbolism of doing this, that it represents a deterioration of our relationship, something that they care about a great deal," the official said.
"We're hoping that this is an incentive that they don't want to see this relationship deteriorate any further and that they're going to commit to working with us to try to find a way to put it on more solid footing."
Special correspondent Sahi reported from Islamabad, and Los Angeles Times staff writers Bengali and Wilkinson from Mumbai, India, and Washington, respectively.
Follow @SBengali on Twitter for more news from South Asia.
1 p.m: This article was updated with additional background, details and quotes from U.S. officials.