Using unusually outspoken language, the U.S. defense secretary Leon Panetta has warned Pakistan that his country is losing patience with Islamabad for allegedly harboring militants.

Panetta, who just departed from India, made these comments while making an unannounced trip to Kabul, Afghanistan, in the wake of a recent surge in insurgent attacks, including an assault on Wednesday that killed 22 people near a NATO base in Kandahar.

“I think it's important to make sure we are aware of the kind of attacks [the Taliban] are going to engage in... as we go through the rest of the summer,” Panetta said in Kabul.

We are reaching the limits of our patience here.”

He also told NATO troops at the Kabul airport: “We have every responsibility to defend ourselves and... we've got to put pressure on Pakistan to take them on as well”

The U.S. defense boss demanded that Pakistani authorities do more to stamp out militants, including the Taliban and Haqqani groups, who launch attacks on NATO troops in Afghanistan from their havens on the Pakistani side of the wild, lawless northwestern border.

The Haqqani, a group believed to be linked to al-Qaeda, is reportedly based in the North Waziristan region of Pakistan, an area that neither Pakistan nor Afghan authorities have any control over. Haqqani fighters are reputedly very well-trained and number in the thousands.

It's an increasing concern that Haqqani safe havens still exist on the other side of the border,” Panetta said.

“Pakistan has to take action from allowing terrorists in their country to attack our forces on the other side of the border. It is difficult to achieve peace in Afghanistan as long as there is safe haven for terrorists in Pakistan.”

Again, Pakistan has denied that it is providing safe havens for militants, citing that it too has sacrificed hundreds of lives of its own government troops in military operations against the militants in the tribal areas in question.

Panetta’s bluntness suggests that the façade of cordiality between Washington and Islamabad has all but evaporated -- relations between the two erstwhile allies have plunged since U.S. commandoes found and killed al-Qaeda terror leader Osama bin Laden in a Pakistani compound last May.

Suspicions in Washington that Pakistani military and intelligence networks are protecting and cooperating with the militants they are supposed to be fighting have escalated ever since.

On the Pakistani side of the equation, anger is rising over the U.S. practice of using drone strikes in the tribal areas. While these missions are designed to kill known militants, Pakistan complains that many innocent civilians have died in these unmanned attacks.

In retaliation for these controversial strikes and the accidental killing of two dozen Pakistani soldiers by U.S. missiles last year, Pakistan has closed off key NATO supply routes into Afghanistan

However, while relations between the U.S. and Pakistan are clearly strained and nearing a breaking point, the U.S. and NATO desperately needs Pakistan’s support and cooperation with respect to the security situation in Afghanistan -- as most international troops will depart the country by the end of 2014.