These days, the relationship between Moscow and Washington is turning frosty again, over a number of issues. But, quietly, American and Russian spies continue to collaborate to combat drug trafficking and organized crime, and to secure nuclear arsenals.

The relationship between the C.I.A. and the I.S.I. was far less complicated when the United States and Pakistan were intently focused on one common goal: kicking the Soviet Union out of Afghanistan. For years in the 1980s, the C.I.A. used the I.S.I. as the conduit to funnel arms and money to Afghan rebels fighting Soviet forces in Afghanistan.

But even in those good old days, the two spy services were far from trusting of each other  in particular over Pakistan’s quest for nuclear weapons. In his book “Ghost Wars,” the journalist Steve Coll recounts how the I.S.I. chief in the early 1980s, Gen. Akhtar Abdur Rahman, banned all social contact between his I.S.I. officers and C.I.A. operatives in Pakistan. He was also convinced that the C.I.A. had set up an elaborate bugging network, so he had his officers speak in code on the telephone.

When the general and his aides were invited by the C.I.A. to visit agency training sites in the United States, the Pakistanis were forced to wear blindfolds on the flights into the facilities.

Image MASTER SPY Pakistans new army chief, Gen. Ashfaq Kayani, (with Pervez Musharraf, left) used to run the I.S.I. Credit... Anjum Naveed/Associated Press

Since the Sept. 11 attacks, C.I.A. officers have arrived in Islamabad knowing they will probably depend on the I.S.I. at least as much as they have depended on any liaison spy service in the past. Unlike spying in the capitals of Europe, where agency operatives can blend in to develop a network of informants, only a tiny fraction of C.I.A. officers can walk the streets of Peshawar unnoticed.

And an even smaller fraction could move freely through the tribal areas to scoop up useful information about militant networks there.