United States defence secretary Leon Panetta says his country is reaching the limits of its patience with Pakistan because of the safe havens the country offers to insurgents in neighbouring Afghanistan.

It was some of the strongest language by a senior US official to describe the strained ties between Washington and Islamabad.

"It is difficult to achieve peace in Afghanistan as long as there is safe haven for terrorists in Pakistan," Mr Panetta said.

"It is very important for Pakistan to take steps. It is an increasing concern, the issue of safe haven, and we are reaching the limits of our patience."

He was speaking in the Afghan capital Kabul, where he held talks with military leaders amid rising violence in the war against the Taliban.

US secretary of state Hillary Clinton also implicitly defended Washington's use of drone strikes against suspected militants, just days after one of them killed Abu Yahya al-Libi, Al Qaeda's second-ranking leader, in north-west Pakistan.

"We will always maintain our right to use force against groups such as Al Qaeda that have attacked us and still threaten us with imminent attack," Ms Clinton said in Istanbul at a meeting of the Global Counterterrorism Forum, a US-and Turkish-chaired group.

It is difficult to achieve peace in Afghanistan as long as there is safe haven for terrorists in Pakistan. It is very important for Pakistan to take steps. It is an increasing concern, the issue of safe haven, and we are reaching the limits of our patience.

US defence secretary Leon Panetta

Pakistan has termed the attacks as illegal and a violation of its sovereignty.

The US has long pushed Islamabad to do more to help in the war against militancy.

Pakistan's ambassador to the US said Mr Panetta's comments would make it harder for the two countries to narrow their differences.

"It adds an unhelpful twist to the process and leaves little oxygen for those of us seeking to break a stalemate," Pakistan's envoy, Sherry Rehman, said in a statement.

'Increasing concern'

Mr Panetta urged Pakistan to go after the Haqqani militant network, one of the US's most feared enemies in Afghanistan, and said Washington would exert diplomatic pressure and take any other steps needed to protect its forces.

He blamed the group for an attack last week on a US base in the east of Afghanistan in which several insurgents, including some wearing suicide vests, used rocket-propelled grenades.

The attack was foiled, but it underlined the challenge facing Western and Afghan forces in the east where insurgents take advantage of the steep, forested terrain and the Pakistani border to launch attacks and then slip away, commanders say.

"What happened the other day in Salerno is an indication that they are going to continue to come at us and, let me be clear, anybody who attacks US soldiers is our enemy and we are going to take them on. We have got to be able to defend ourselves," Mr Panetta told US troops earlier at Kabul airport.

NATO has signed an agreement with three countries to the north of Afghanistan for land routes as the US-led alliance begins a withdrawal of its forces from the country next year.

NATO chief Anders Fogh Rasmussen said earlier this week the "reverse transit" deal was signed with Uzbekistan, Kazakhstan and Kyrgyzstan.

Pakistan closed the shorter and cheaper routes through its territory last year to protest a cross-border NATO air attack that killed 24 Pakistani soldiers. Discussions to reopen the Pakistan routes have stalled.