The recent chief-of-station (COS) cover-shredding brouhaha between the Central Intelligence Agency (CIA) and Pakistan’s Inter-Services Intelligence (ISI) Directorate marks an ironic and possibly important shift in the historic affection that Langley has had for Pakistan’s premiere intelligence service. It’s uncommon for a COS to be yanked home from a country where the CIA has enjoyed a pretty intimate relationship with the host service; it’s certain that the Agency did not do so just because the true name of an operative surfaced in the press due to a drone-provoked wrongful death lawsuit.

It’s the political and operational ambience that surrounds the public lifting of the chief’s cover—whether the ISI encouraged the legal case or abetted its publicity—that is probably most disturbing to Langley. FYI: It’s a good bet that every significant terrorist organization in Pakistan, including Al Qaeda, knew the COS’s true identity within weeks of his arrival in country. Chiefs-of-station are well-known personalities among the political and military elites in loquacious Third World countries; in Pakistan, where both civilian and military VIPs can have sympathetic contacts with militant Islamic groups, this “overt” presence of “liaison” CIA officers adds complexity to a fact of most case officers’ lives: the irreversible erosion of cover.

From the Soviet–Afghan War (1979–1989) until recently, Langley had been dutiful, if not zealous, in defending—or more often ignoring—the ISI’s most egregious behavior, especially in its support of violent Islamic militants in Afghanistan and Kashmir. Even after September 11, former chiefs-of-station in Pakistan could defend Pakistani support of the Taliban, including Pakistani support of Gulbuddin Hekmatyar, one of the nastiest Pashtun Islamic militants and certainly the only one ever to build fan clubs inside the CIA, Iran’s Revolutionary Guard Corps, and the ISI. (To be fair to Langley: Former Islamabad chief Milt Bearden didn’t ideologically admire Hekmatyar; but could praise the warlord’s eagerness to attack Soviets on an ISI/CIA approved schedule. Rootless, tribe-free, ideology-driven holy warriors did have their operational advantages over insurgents like Ahmed Shah Masoud, the Lion of the Panjshir, who fought only in the lands of his kith and kin.) Excuses for the Pakistanis have come far too easily to the lips of senior CIA case officers—as they have from many officials at the State Department and the Pentagon. These excuses are fewer now because Pakistani-aided Afghan Taliban insurgents are killing Americans and Europeans.

But a change of heart now in Langley about the ISI, and more broadly about Pakistan, is worrisome (however pleasingly ironic). Pakistan’s democratically elected government has been far more successful infighting its own Islamist demons, especially its Pashtun jihadists in the Federally Administered Tribal Areas and the North-West Frontier Province, than was the military dictatorship of Pervez Musharraf. However erratically and incompetently, the Pakistani military, including its loyal intelligence servant, the ISI, has invested more of its blood and treasure in fighting Pakistani Taliban and other Islamic militants than it ever has in the past.

That Pakistanis also play a double game, with us and with themselves, is beyond question: Old habits die hard, especially when those habits are grounded in ethnicity and faith. Pakistan’s pre-September 11 worldview had a certain holistic logic. Afghanistan—the Taliban war against the Tajik-dominated Northern Alliance, which became a laboratory for Central Asian Islamic militants with a sense of adventure and a high testosterone count—was an escape valve for Pakistani Pashtun religious fervor.

Non-Pashtun Pakistanis of the Sindh and the Punjab have never known exactly what to do with their Pashtuns, who don’t meld well with the “more civilized” peoples of the south. (Putting them into the army has been an effective means of solidifying ties.) Afghanistan also offered secular Pakistanis a place to show their religious bona fides. It offered a training ground for Kashmiri rebels, which appealed to just about everyone south of the Durand Line. Annoying—wounding—Hindu India is an essential part of the nation’s Islamic soul. If Americans or other Westerners perished because of the flowering of religious militancy in Taliban-controlled Afghanistan, that was, well, acceptable collateral damage. When that turned out not to be okay, when America responded with unexpected power, Islamabad’s understanding of how their own country worked ceased to function.

Yet Pakistan is making progress: The national discussion about religious militancy and the national identity is vivid, almost as vibrant as the lectures about America’s missteps and sins. Washington’s urgent expectations of Islamabad—that it must do more to stop the Afghan Taliban from using Pakistan as a base of operations, often with the assent of the Pakistani army—are understandable, and necessary, but unrealistic. It takes time—much more time than President Barack Obama had initially wanted to give—for Pakistanis to re-order their universe. This is happening: The thousands of Pakistani lives lost since September 11 in the fight against homegrown Islamic militants is the most convincing proof of an intellectual realignment, within the army and the civilian secular elite.

This revolution—and it’s perhaps not too early to use this word—will continue and, inshallah, become irreversible when the Pakistani military and civilian elites know that the old world has been irretrievably shattered. Which means, first and foremost, that Afghanistan will not revert to a state of civil war, where the Pashtuns again begin their march on Kabul, dragging the Pakistani army along with them. Civil strife among the Pakistanis, which is healthy and essential, could be quieted in a renewed northern mission civilsatrice. Civil war in Afghanistan is crack for Pakistanis: All of their worst instincts supercharge.

Which brings us back to the CIA. With understandable bitterness, senior U.S. military officers now constantly underscore Pakistan’s nefarious role in aiding the Afghan Taliban. American journalists who talk to these officers echo these complaints. Washington’s innumerable conferences further amplify the echo chamber: “We cannot win unless the Pakistani problem is solved.” And now we have added the CIA’s voice to this mix, and it will grow louder in forthcoming National Intelligence Estimates and Special National Intelligence Estimates (whenever America gets into trouble, we get SNIEs).

It’s a truly odd twist of fate that the folks the CIA loved to belittle during the Soviet-Afghan conflict and during the Taliban wars between 1994 and 2001—the Tajiks of the Panjshir Valley—have become an important conduit of information for CIA officials who don’t have comparable networks among the Pashtuns. And, the Tajik view of the Pakistanis is—quite understandably—unrelentingly negative.

As was obvious in Iraq, the CIA’s grasp of a country, especially a violent one where case officers cannot move about freely, is rarely deep and tends to echo those foreigners with whom it primarily deals. (In Iraq, this was the Sunni Arab community, and especially those Sunni Arabs revolving around Iyad Allawi.) A CIA spurned in Islamabad could well spin emotionally the other way and become too anti-Pakistani, a disposition encouraged by the Tajiks, with whom the CIA now probably has its most privileged relations. (I really like Tajiks, so I certainly understand why case officers would want to spend more time with them than with the more difficult, more closed Pashtuns.)

But the CIA’s added voice might produce a tipping point in Washington, where the left is already uniting with the realist right (see the most recent anti-surge essay by the Council on Foreign Relations boss Richard Haass in The Wall Street Journal) behind a nashtun nationalism with Islamic militancy—hasn’t yet reignited on a large scale (in large part because Afghan Pashtuns can remember how unpleasant the Taliban were the first time round).

If properly resourced, the U.S. military really ought to be able check the Taliban from terrorizing the most crucial settled areas in the Pashtun zone. (And contrary to many press reports, the Afghan North, where the Pashtuns live in relatively small numbers, is not on fire.) The issues in Afghanistan, like in Pakistan, are resources and time.

Are we willing to stay until at least 2014, a plausible date for beginning an American drawdown in the country? Are we willing to spend $100 billion per year to ensure that we don’t return to the pre-September 11 status quo in both Afghanistan and Pakistan? Or are we willing, finally, to play the khan, the local ruler who dispenses justice, and play hardball with the country’s abusive warlords? Secretary of Defense Donald Rumsfeld and his generals made a serious error, from which we’ve not recovered: They never challenged the reviled status quo. They cared too much about the warlords and too little about the people. As in Iraq, all they really wanted to do was leave.

We shouldn’t fool ourselves: If we take away American troops on the ground, our ability to wage war against Al Qaeda-affiliated forces in Afghanistan will cease to exist. (Many in Washington are afflicted with what might be called the Over-the-Horizon-Yemen-Want-To-Be-Predator-Drone-Hubris Syndrome.) A forced American withdrawal will be a stunning victory for the Taliban and those who’ve been their dogged supporters in Pakistan.

We won’t get to ignore the next Afghan civil war: We will have to choose sides, which will put us in an armed conflict against Islamabad. The Taliban’s ideological brew is unlikely to go dormant upon our departure (“We’ve won, so now we’ll behave—no more Al Qaeda and holy war for us”). The Taliban–Al Qaeda fusion, which is already advanced (it’s much more intertwined now than it was on September 11, 2001), will continue on both sides of the Durand Line. Pakistan is today a headache. But it could get a lot worse. This may seem like an abstract scenario to many on the left and the “realist” right (September 11 is, in American years, a long time ago), but to the CIA, which remains the vanguard in our battle against Islamic militancy, it might not be. And in that, there is hope. As much as Langley may now despise the Pakistanis, we are still wedded to them. And a bad marriage here is much, much better than an acrimonious divorce.

Reuel Marc Gerecht is a senior fellow at the Foundation for Defense of Democracies, a contributing editor at The Weekly Standard, and author of the forthcoming The Wave: Man, God, and the Ballot Box in the Middle East.