Thirteen years ago, Defense Secretary Donald Rumsfeld arrived in Pakistan with a list. He pulled it from his shirt pocket during a meeting with President Pervez Musharraf, and told the general how, during a recent Oval Office gathering, President George W. Bush had expressed bewilderment and annoyance that most of the terrorists on the list were suspected of hiding out in Pakistan—an ostensible American ally. Musharraf promised to look into the matter, according to a participant in the meeting. And, less than a month later, Pakistan’s military intelligence agency, the Inter-Services Intelligence, or I.S.I., arrested one of the men atop the list. “Here’s the truth,” a former senior U.S. intelligence official told me. Pakistan has been “in many ways” America’s best counterterrorism partner, the official said. “Nobody had taken more bad guys off the battlefield than the Pakistanis.”

Yet there was, and remains, a maddening quality to their coöperation, the official said. Pakistan’s intelligence service went “all in” against certain terrorists, like Al Qaeda and the Pakistani Taliban, while continuing to support the Afghan Taliban, the Haqqanis, and anti-India jihadis. On at least two occasions, the former acting C.I.A. director Michael Morell flew to Pakistan with a list of militants the United States hoped Pakistan would apprehend or confront. Just last month, Defense Secretary James Mattis went there on a similar mission. “It’s frustrating. Our talking points have been identical for the last fifteen years: ‘You need to get tough on terrorism, and you need to close the sanctuaries,’ ” one former intelligence official told me.

Last week, Donald Trump became the third President to echo that frustration. “The United States has foolishly given Pakistan more than 33 billion dollars in aid over the last 15 years,” he tweeted. “They have given us nothing but lies & deceit.” Three days later, the Trump Administration went further than its predecessors when the State Department announced that it was suspending military-equipment deliveries and financial assistance to Pakistan until the country took, in the words of a senior Administration official, “decisive action” against the Afghan Taliban, the Haqqani network, and other groups that “threaten U.S. interests and U.S. personnel” in Afghanistan. The value of suspended funds totals approximately two billion dollars, and includes military equipment that Pakistan ordered in 2013 but has not yet received.

American officials have never been blind to the Pakistani agency’s duplicity. It was “baked into the stock price of U.S.-Pakistan relations,” said Joshua White, a former national-security council adviser in the Obama Administration. And, in general, Pakistani coöperation with America’s counterterrorism campaign has been strong: their government permitted the C.I.A. to fly armed drones over Pakistan’s remote tribal areas, where many militants hid. Initially, the agency even based its drones on Pakistani soil, working off a list jointly drawn up with its I.S.I. counterparts. As those on the “target deck” were killed, new names—most of them foreign Al Qaeda leaders—were added.

That close collaboration has eroded over the years. In 2010, the identity of the C.I.A.’s station chief, Jonathan Bank, appeared in the Pakistani press in what American officials suspected was a leak planted by the I.S.I. Bank’s replacement, Mark Kelton, arrived at an inopportune time: a day after he showed up, two Pakistani men died in an altercation in Lahore with a C.I.A. contractor, Raymond Davis, who claimed that the men had tried to rob him. And Kelton was still there when, in May, 2011, Navy SEALs helicoptered into Pakistan, stormed Osama bin Laden’s compound, and killed the Al Qaeda leader. At one point, the I.S.I. chief at the time, Ahmed Shuja Pasha, told the U.S. Ambassador, Cameron Munter, how Kelton, who could be dour, reminded him of a “walking cadaver.” Not long after, Kelton fell ill. He suspected that he had been poisoned.

Eventually, the C.I.A. stopped notifying the I.S.I. of drone strikes in advance. Pakistani officials, in turn, exaggerated the number of civilians killed in the American strikes, according to several former officials. The C.I.A. has been exacting in its efforts to avoid civilian casualties, officials told me. For instance, in May, 2013, according to two former intelligence officials, agency drones spotted Wali-ur-Rehman, the deputy emir of the Pakistani Taliban, on the roof of a compound where, in the summer months, it was cooler than sleeping inside. There was a clear shot from the drone circling overheard, but analysts at C.I.A. headquarters were wary that a direct strike would bring the whole house down, and kill numerous women and children inside. After studying the house for hours, they decided that they could fire the missile from an oblique angle, killing Rehman and his associates on the roof, while saving those below. The Predator dropped into a low orbit and fired several missiles, which skimmed the roof and killed Rehman. The officials said that no civilians died.

By 2015, the C.I.A. had begun to run out of Al Qaeda targets in Pakistan; there were ten drone strikes reported in Pakistan that year, compared to a hundred and twenty-two in 2010. “The center of gravity for Al Qaeda was in the process of a fundamental shift from Pakistan to Syria,” Joshua Geltzer, the former senior director for counterterrorism on Obama’s national-security council, told me. And though the Trump Administration has presented its new policy as a correction to America’s past failings in Pakistan, current and former national-security officials said it was the C.I.A.’s counterterrorism successes there, and Al Qaeda’s corresponding weakness in Pakistan, which have enabled Trump to take a harder line. In short, Al Qaeda’s operation in Pakistan just does not represent the threat it once did. The former C.I.A. director Michael Hayden declined to comment on, or even acknowledge, the C.I.A.’s drone program, but he told me that he applauded Trump’s decision, and said, “He may be confident enough that we have sufficiently shaped the environment that the downsides are manageable.”

Al Qaeda, however, is not the only terrorist group in Pakistan. Militants based there, particularly the Haqqani network, continue to carry out deadly attacks on civilians and Afghan and American forces in Afghanistan. White, the former South Asia adviser, said, “The outstanding list of Al Qaeda-affiliated figures is small. But the Haqqani list is moving in the other direction.” And when American officials have asked the Pakistani military and intelligence officials to pressure the Haqqanis, White said, “They were at times minimally responsive, but we always hit a wall.”

Trump’s national-security adviser, H. R. McMaster, has endorsed a harder line against Pakistan as part of a plan to reinvigorate the war against the Taliban in Afghanistan. Last year, McMaster saw a report by Lisa Curtis, a research fellow at the Heritage Foundation, and Husain Haqqani, the former Pakistani Ambassador to the U.S. (and of no relation to the Haqqani network in North Waziristan), titled “A New U.S. Approach to Pakistan.” In it, Curtis and Haqqani argue that the Trump Administration should “stop chasing the mirage” that Pakistan might change its approach to confronting certain terrorist groups without the threat of withholding aid. “Pakistan is not an American ally,” they write.

McMaster asked Curtis—an experienced Pakistan analyst who had worked at the C.I.A. and the State Department—to join the national-security council as the senior director for South and Central Asia. The paper she co-wrote with Haqqani has become the “blueprint” for Trump’s Pakistan policy, according to a source familiar with the Administration’s deliberations. After last week’s suspension of aid, the question is, what next? In their paper, Curtis and Haqqani propose that the U.S. might threaten to designate Pakistan a “state sponsor of terrorism,” which could cause a near-total rupture in relations between the two countries and, perhaps, even the sanctioning of current and former Pakistani officials.

Pentagon and State Department officials have resisted the new hard-line approach, citing the risk that Pakistan could cut off the land and air routes that the U.S. uses to supply American forces in Afghanistan. State Department officials were also reportedly blindsided by Trump’s tweets last week. (Defense Secretary Mattis has repeatedly discouraged other Administration officials from issuing ultimatums. A senior defense official told me, of Mattis, “He’s still making his case.”) The senior Administration official disputed claims that the Defense and State Departments were not part of developing the new approach, and the characterization of Curtis and Haqqani’s paper as the “blueprint” for the policy change. “There is a robust interagency process,” the official told me. “There are many people involved in the policy process. There is a deliberative process.”

More importantly, the official said, last week’s announcement reflected the Trump Administration’s “broader strategy” in Afghanistan: a political settlement between the Afghan government and the Taliban. But, the official added, “We believe that so long as the Taliban and the Haqqani network feel they have a safe haven in Pakistan, they will be less motivated to come to the negotiating table.”

One of the former intelligence officials said that he sympathized with Trump’s stern position. But expecting the I.S.I. to dump the Haqqanis and the Taliban struck him as being as naïve and Pollyannaish as blaming America’s failures in Afghanistan on Pakistan. “Even if Pakistan becomes the most benign country in the world, Afghanistan is not going to be Switzerland,” he said.