Image caption Relations between Pakistan and the US have recovered somewhat following the crisis sparked by the US killing of Osama Bin Laden in May 2011

US Secretary of State John Kerry has agreed to resume high-level talks over security issues with Pakistan.

The agreement was made after Mr Kerry met senior Pakistani politicians, including new PM Nawaz Sharif.

The talks were stalled after 24 Pakistani soldiers were killed in US air strikes on a Pakistani post on the Afghan border in 2011.

Relations were also strained by the US killing of al-Qaeda leader Osama Bin Laden in May of that year.

Speaking after the talks on Thursday, Mr Kerry said they were "constructive" and "positive".

"We are here to speak honestly with each other, openly about any gaps that may exist that we want to try to bridge," Mr Kerry said. "Our people deserve that we talk directly."

He said the two sides were serious about overcoming past irritants and that he had invited the new prime minister to Washington to meet US President Barack Obama.

Analysis Mr Kerry's visit to Islamabad is essentially to renew what he calls a "full partnership" with Pakistan. The aim is apparently to offer crucial financial inputs to revive Pakistan's economy, and to obtain greater Pakistani co-operation in counter-terrorism before the Nato drawdown of troops in Afghanistan. Both sides agree that there are difficulties. Pakistani concerns over drone strikes are not likely to be addressed by the US, and the Pakistanis may continue to go slow on American demands of wiping out militant safe havens on its territory. But both sides feel they will need to make some progress over the next six months when a fully fledged strategic dialogue, broken off in October 2010, will resume between the two countries. They expect further progress in the wake of the Afghan presidential election next spring, and the public message from the Americans that they intend to retain troops in Afghanistan beyond 2014 for counter-terrorism operations and to train and equip the Afghan army.

The secretary of state said the common interests of Pakistan and the US outweighed any differences they had.

"The Pakistan-US relationship is not defined by threats we face and is not just about counter-terrorism, but about the economic revival of Pakistan," he said.

He emphasised their relationship was strong enough to withstand threats from the extremists.

The BBC's M Ilyas Khan in Islamabad says the resumption of the "strategic dialogue'' indicates that their relationship has improved since the low points of 2011 and is now on course to normalisation after nearly three years of bad blood.

The closed-door talks between Mr Kerry and Mr Sharif focused on the economy, Pakistan's energy shortages and security ahead of Nato's withdrawal from Afghanistan next year, officials said.

Mr Kerry insisted the US was "drawing down, not withdrawing" from Afghanistan and that he was confident Washington would reach agreement on future troop levels with Afghan President Hamid Karzai.

Mr Kerry also strove to ease tension over controversial US drone strikes against suspected militants.

CIA strikes killed up to 3,460 people in Pakistan between 2004 and 2013.

The troubled border region of North Waziristan is considered an al-Qaeda and Taliban stronghold and US drones regularly target the area.

Mr Sharif, who won elections in May, has demanded an end to such attacks, saying they violate his country's sovereignty.

Parts of the Pakistani government and military have often been accused of criticising the use of drones in public, but co-operating in private.

Earlier this year, Mr Obama said the strikes were part of a legitimate campaign against terrorism, but he also pledged more transparency and stricter targeting rules.

'Historic transition'

The US secretary of state also held talks with Pakistani army chief Gen Ashfaq Kayani and President Ali Asif Zardari in Islamabad on Thursday.

US drone strikes in Pakistan Bureau of Investigative Journalism has recorded 368 drone strikes in Pakistan

Every strike has to be approved by US president

Vast majority carried out under Barack Obama

Four US citizens killed in strikes since 2009 UN inquiry into drone killings How drones work Video: Close-up look at drone

It is Mr Kerry's first trip to Pakistan as secretary of state, although he has a long history of dealing with Pakistan as former chairman of the Senate Foreign Relations Committee.

Before the pair began their talks, Mr Sharif described him as "a wonderful friend", while Mr Kerry replied that he "had the pleasure of visiting Mr Sharif's home and having a number of meals with him''.

The secretary of state paid tribute to Mr Sharif's victory at the polls. It marked the first time that an elected civilian Pakistani government completed a full term in office and handed over to another.

"This is a historic transition that just took place. Nobody should diminish it," he told US embassy staff.

US officials travelling with Mr Kerry said Pakistan - although still formulating its counter-terrorism strategy following a spate of militant attacks - is likely to continue clampdowns on militants, but also engage them in talks.

The last visit by a US secretary of state was in 2011, after Osama Bin Laden was killed.