At the same time, the Pakistani spy agency remains a close ally of the C.I.A. in the hunt for operatives with Al Qaeda. It is a relationship that often complicates the ability of the United States to put pressure on Pakistan to alter its tactics.

According to one American law enforcement official, the F.B.I. had originally hoped to arrest the two men working for the charity, the Kashmiri American Council, several times earlier this year but was told each time by the State Department or the C.I.A. that the arrests would only aggravate the frayed relations between the United States and Pakistan.

Image Lt. Gen. Ahmed Shuja Pasha, Pakistan's spymaster. Credit... Anjum Naveed/Associated Press

The indictments came as the C.I.A. was trying to negotiate the release of a Pakistani doctor who was jailed by the ISI on accusations that he had helped the Americans track down Osama bin Laden before his killing.

Washington has long been a venue for spy games between Pakistan and India as they have tried to win favor among lawmakers and White House officials. A senior official at Pakistan’s Embassy in Washington, speaking on the condition of anonymity, said it was customary for intelligence agencies to operate “outside the limelight,” adding that it was unfortunate that the ISI had become a subject of “demonization.”

“There is nothing that the ISI does in the United States that is not part of the normal function of intelligence agencies,” the embassy official said. “The ISI has never deliberately violated an understanding with the U.S. government or deliberately violated American law.”

Several Pakistani journalists and scholars in the United States interviewed over the past week said that they were approached regularly by Pakistani officials, some of whom openly identified themselves as ISI officials. The journalists and scholars said the officials caution them against speaking out on politically delicate subjects like the indigenous insurgency in Baluchistan or accusations of human rights abuses by Pakistani soldiers. The verbal pressure is often accompanied by veiled warnings about the welfare of family members in Pakistan, they said.