Twice in recent weeks, the United States provided Pakistan with the specific locations of insurgent bomb-making factories, only to see the militants learn their cover had been blown and vacate the sites before military action could be taken, according to U.S. and Pakistani officials.

Overhead surveillance video and other information was given to Pakistani officials in mid-May, officials said, as part of a trust-building effort by the Obama administration after the killing of Osama bin Laden in a U.S. raid early last month. But Pakistani military units that arrived at the sites in the tribal areas of North and South Waziristan on June 4 found them abandoned.

U.S. officials say they do not know how the operation was compromised. But they are concerned that either the information was inadvertently leaked inside Pakistan or insurgents were warned directly by Pakistan’s Inter-Services Intelligence directorate, or ISI.

A senior Pakistani military official said Friday that the United States had also shared information about other sites, including weapons-storage facilities, that were similarly found empty. “There is a suspicion that perhaps there was a tip-off,” the official said. “It’s being looked into by our people, and certainly anybody involved will be taken to task.”

In the past, Pakistan has strenuously denied allegations that its security services are colluding with insurgents.

The incidents are expected to feature prominently in conversations between Pakistani officials and CIA Director Leon Panetta, who arrived in Pakistan on Friday. The U.S. argument, one official said, will be: “We are willing to share, but you have to prove you will act. Some of your people are no longer fully under your control.”

U.S. officials said Panetta would also carry a more positive message, reiterating that the United States wants to rebuild a trusting, constructive relationship with Pakistan. Immediately after bin Laden’s death, some administration officials and lawmakers argued that the al-Qaeda leader’s presence in a suburban Pakistani compound was reason enough to withhold U.S. assistance from Pakistan. But the prevailing view has been that the two countries need each other despite their problems.

Pakistan has frequently responded to U.S. entreaties to move against insurgent safe havens in the tribal areas by asking for proof of their presence. Officials said that video of the two installations indicated both were being used to manufacture improvised explosive devices, or IEDs — the roadside bombs that are the principal killers of U.S. and coalition troops in Afghanistan.

One was located in a girls’ school in the city of Miram Shah, home to the Haqqani network’s North Waziristan headquarters. The other, in South Waziristan, was thought to be an al-Qaeda-run facility, according to officials who spoke on the condition of anonymity because of the sensitivity of the issue.

While the United States has conducted an aggressive campaign of drone strikes in the tribal areas, both sites were considered poor drone targets because of the high potential for civilian casualties.

The video was handed over to Pakistani army chief Gen. Ashfaq Kayani and ISI head Lt. Gen. Ahmed Shuja Pasha during a visit last month by Marc Grossman, the Obama administration’s special representative to Afghanistan and Pakistan, and CIA Deputy Director Michael J. Morell. The classified videos have also been shown to members of the congressional intelligence committees.

After the visit by Grossman and Morell, the administration also demanded in a series of high-level telephone calls that the CIA be given access to the compound in the city of Abbottabad where bin Laden was killed.

That access was granted two weeks ago, leading to a visit by Secretary of State Hillary Rodham Clinton and Adm. Michael Mullen, chairman of the Joint Chiefs of Staff. At that time, Clinton asked about action on the videos. She has since followed up with two telephone calls to Prime Minister Yousaf Raza Gillani.

The two installations had been cleared out before Pakistani military units moved against them on June 4, satellite imagery subsequently revealed.

A local security official in North Waziristan confirmed that Pakistani forces had raided the girls’ school after militants had abandoned it. A local tribal official, who, like the security official, spoke on the condition of anonymity, said it is common for insurgent groups to use schools and hospitals to manufacture weapons.

Tense relations

When Clinton visited Pakistan two weeks ago, she said Washington expected to see “decisive steps” from Pakistan “in the days ahead.”

But in recent weeks, Pakistan has seemed only to further distance itself from its U.S. alliance, forcing out most of the 135 U.S. troops who had been here training Pakistani forces.

On Thursday, Kayani issued a pointed statement that called for U.S. military aid for Pakistan to be converted into economic assistance, demanded an end to U.S. drone strikes in the tribal areas and insisted Pakistan would not be pressured into conducting military operations.

The United States has been pushing Pakistan for more than a year to mount an offensive in North Waziristan. But Pakistan has resisted the calls, saying its forces are already stretched too thin.

Tribal leaders in North Waziristan said Friday that a government official had recently visited the area and told residents not to leave their homes, because no military operation was imminent.

In addition to pressure from the United States, Pakistan’s military has faced intense domestic criticism since the May 2 raid.

On Friday, opposition leader and former prime minister Nawaz Sharif accused the army of running “a parallel government” and demanded that it end its “dominance of Pakistan’s foreign policy.” The comments were unusually bold in a country where civilian politicians have long bowed to the military’s authority.

Panetta, who has been nominated to be the next U.S. defense secretary, left for Pakistan soon after confirmation hearings on Capitol Hill concluded Thursday. Pakistan’s army issued a terse statement saying that Panetta had met with Kayani, and the two discussed “the framework for future intelligence sharing.”

Karzai arives for talks

Panetta’s arrival coincided with that of Afghan President Hamid Karzai, who traveled to Islamabad on Friday for two days of talks with top Pakistani leaders amid cautious hopes that the two nations can forge a coordinated strategy for reconciling with insurgents.

The two governments have long mistrusted one another, with Afghan officials accusing Pakistan of covertly backing the Taliban and other militant groups. But tensions have eased in recent months, and Afghan officials said Karzai’s visit will help to test Pakistan’s assertions that it is prepared to play a constructive role in ending the war in Afghanistan after more than three decades of conflict.

“There is a change of attitude here,” said Mohammad Umer Daudzai, the Afghan ambassador to Pakistan. “Pakistan has been badly hurt by militants. They are under pressure. So we have to realize that this is an ideal opportunity.”

But Daudzai also acknowledged that any negotiated solution to the war is a long way off. Pressed on a likely deadline, he cited 2014, when foreign troops are slated to hand over security responsibility to the Afghan government.

DeYoung reported from Washington. Special correspondents Haq Nawaz Khan in Peshawar and Shaiq Hussain in Islamabad contributed to this report.