Washington - The Pakistani government, through its intelligence service, is "actively involved" in directing the militant Haqqani network to launch terrorist attacks against U.S. and Afghan government targets in Kabul, U.S. military officials tell NBC News.

The officials told NBC News the ISI, Pakistan's powerful spy agency, directed the attacks by Haqqani militants on the U.S. Embassy on Sept. 13 and on the Inter-Continental Hotel on June 28. It's suspected ISI also had a role in the massive truck bombing targeting an American base in eastern Afghanistan on the eve of the 10th anniversary of the 9/11 terror attacks, the officials said.

In a congressional hearing Thursday, Joint Chiefs Chairman Adm. Mike Mullen called the Haqqani network a "veritable arm" of the ISI. Testifying alongside Mullen, Defense Secretary Leon Panetta said the U.S. has warned Pakistani authorities it will not tolerate a continuation of the group's cross-border attacks.

Military officials told NBC the Pakistanis are convinced that the U.S. is preparing to totally withdraw all its forces from Afghanistan and are "hedging their bets" for when that day arrives. "They're looking ahead, well past the Americans," an official said.

According to one senior military official, "the attacks are aimed at undermining the credibility of the Afghan government" so when the Americans leave, Pakistan will wield some influence over Kabul, NBC reported. "They're double-dealing," cooperating with the U.S. against al-Qaida in Pakistan, on the other undermining (hand) U.S. efforts in Afghanistan."

Mullen and Panetta have publicly emphasized the U.S. is prepared to do whatever is necessary to protect American forces in Pakistan. One official said that could include unilateral U.S. military strikes against the Haqqani network inside Pakistan, but added it would be "foolhardy" to discuss any specific planning.

Pakistan's interior minister, Rehman Malik, immediately denied the allegations and warned the U.S. not to launch military strikes in Pakistani territory. "The Pakistan nation will not allow the boots on our ground, never," said Malik. The U.S. "must respect our sovereignty."

'Veritable arm'

In his final congressional testimony before retiring next week, Mullen said success in Afghanistan is threatened by the Pakistani government's support for the Haqqani network.

Repeating a charge he made earlier this week, Mullen said Thursday that with Pakistani support the Haqqanis were behind not only the Sept. 13 embassy assault but also a recent truck bomb that wounded 77 U.S. soldiers and a June 28 attack against the Inter-Continental Hotel in Kabul - as well as "a host of other smaller but effective operations."

Mullen said Pakistani intelligence is using the Haqqanis and other extremist groups as its proxies inside Afghanistan.

Mullen said Pakistan's government has chosen to "use violent extremism as an instrument of policy," adding that "by exporting violence, they have eroded their internal security and their position in the region. They have undermined their international credibility and threatened their economic well-being."

Mullen also deplored the "pernicious effect" of Afghanistan's own poor governance and corruption.

"If we continue to draw down forces apace while such public and systemic corruption is left unchecked," Mullen told the Senate Armed Services Committee, "I believe we risk leaving behind a government in which we cannot reasonably expect Afghans to have faith. At best this would lead to localized conflicts inside the country; at worst it could lead to government collapse and civil war."

Panetta also decried Pakistani support for the Haqqani network. He said new CIA Director David Petraeus met recently with the head of the Pakistani intelligence agency and told him the U.S. won't stand for continued cross-border attacks by Haqqani militants.

"They must take steps to prevent the safe haven that the Haqqanis are using," Panetta said. "We simply cannot allow these kinds of terrorists to be able to go into Afghanistan, attack our forces and then return to Pakistan for safe haven."

He repeated the point later, adding, "That is not tolerable."

Sen. Carl Levin, D-Mich, chairman of the committee, pressed Panetta on what options are available to the U.S. to go after the Haqqani network. Panetta declined to go into details publicly but made clear that the Pakistanis know what might happen.

"I don't think they would be surprised by the actions we might or might not take," he said. He also said he has not "spelled out" for the Pakistanis what unilateral actions the Obama administration would be willing to take.

Shift in tone

The remarks by Mullen and Panetta highlight a notable shift in the administration's approach to Pakistan. Whereas U.S. officials previously kept their strongest criticisms of Pakistan private, in recent days they have been explicit in linking the government to extremists who are attacking U.S. forces in Afghanistan.

Mullen's strong words are especially notable in light of his role in trying to use personal persuasion to change Pakistani behavior. He told the committee that he has met with his Pakistani counterpart, Gen. Ashfaq Pervez Kayani, more than two dozen times over the past four years, and he defended the rationale for cultivating that link.

"Some may argue I have wasted my time, that Pakistan is no closer to us than before and may now have drifted even further away," he said. "I disagree." He said cooperation from the Pakistani military is improving.

Sen. Susan Collins, R-Maine, asked Panetta whether he supports a move in Congress to condition further U.S. aid to Pakistan on the administration being able to certify that the Pakistani government is cooperating with the U.S. in fighting extremist groups, including the Haqqanis.

"Anything that makes clear to them that we cannot tolerate their providing this kind of safe haven to the Haqqanis, and that they have to take action - any signal that we can send to them - I think would be important to do," Panetta said.

The Associated Press contributed to this report.