But in the shadows, far from the public rancor, Pakistani-U.S. cooperation quietly continued. In Quetta, the Taliban’s capital in exile, U.S. intelligence was monitoring the cellphone of the presumed planner of any Qaeda anniversary attacks, Younis al-Mauritani, the group’s newly named external operations chief. The Americans’ tracking data—signals intelligence, or sigint, as it’s known in the profession—was being shared in real time with the local branch of Pakistan’s paramilitary Frontier Corps. When his exact location was discovered, the Pakistanis smashed through the doors of his safe house and grabbed him along with two deputies.

Soon he was hundreds of miles away, at a special detention center in Punjab province, under intensive interrogation by a pro-U.S. faction of Pakistan’s Inter-Services Intelligence directorate. The Americans began getting regular reports on potential threats connected to the anniversary. CIA officials were even given an “unofficial” visit to question Mauritani directly…

Within the ISI, America’s most reliable ally has been the spy service’s division known as the T Wing. It was created largely from scratch in 2006 and 2007, after the Americans mostly gave up trying to work with the ISI’s uncooperative leadership. U.S. officials say their hope was that the T Wing, which conducted Mauritani’s interrogation, might help to offset the pernicious influence of the ISI’s S Wing, the division in charge of managing the Pakistani government’s relationship with Islamic extremist groups such as the Kashmiri separatist Lashkar-e-Taiba and Afghanistan’s Taliban. According to the same officials, America also has embraced and funded units connected to Pakistan’s Interior Ministry, particularly in the corruption-ridden megalopolis of Karachi, where the local police are not considered reliable counterterrorism partners.