Lt. Gen. Martin E. Dempsey, the acting commander of American forces in Southwest Asia, made an unannounced visit to the tribal areas on Monday, a further reflection of American concern.

The ISI has for decades maintained contacts with various militant groups in the tribal areas and elsewhere, both for gathering intelligence and as proxies to exert influence on neighboring India and Afghanistan. It is unclear whether the C.I.A. officials have concluded that contacts between the ISI and militant groups are blessed at the highest levels of Pakistan’s spy service and military, or are carried out by rogue elements of Pakistan’s security apparatus.

With Pakistan’s new civilian government struggling to assert control over the country’s spy service, there are concerns in Washington that the ISI may become even more powerful than when President Pervez Musharraf controlled the military and the government. Last weekend, Pakistani military and intelligence officials thwarted an attempt by the government in Islamabad to put the ISI more directly under civilian control.

Image An image from a video showing Maulavi Jalaluddin Haqqani, who leads a militant network in Pakistans western tribal areas.

Mr. Kappes made his secret visit to Pakistan on July 12, joining Adm. Mike Mullen, the chairman of the Joint Chiefs of Staff, for meetings with senior Pakistani civilian and military leaders.

“It was a very pointed message saying, ‘Look, we know there’s a connection, not just with Haqqani but also with other bad guys and ISI, and we think you could do more and we want you to do more about it,’ ” one senior American official said of the message to Pakistan. The official was briefed on the meetings; like others who agreed to talk about it, he spoke on condition of anonymity because of the diplomatic delicacy of Mr. Kappes’s message.

The meetings took place days after a suicide bomber attacked the Indian Embassy in Kabul, killing dozens. Afghanistan’s government has publicly accused the ISI of having a hand in the attack, an assertion American officials have not corroborated.