Secretary of State John Kerry said Thursday that Washington planned to end drone strikes in Pakistan soon — a message aimed at removing a major source of anti-American resentment in the strategically important country.

After meeting Pakistan’s Prime Minister Nawaz Sharif, Kerry said they had agreed to re-establish a “full partnership”, hoping to end years of acrimony over the drone strikes and other grievances, including the unsanctioned 2011 U.S. raid that killed Osama bin Laden.

In a television interview later, Kerry said of the drone strikes: “I think the program will end as we have eliminated most of the threat and continue to eliminate it.”

“I think the president has a very real timeline and we hope it’s going to be very, very soon,” he told Pakistan Television, when asked whether the United States had a timeline for ending drone strikes, aimed at militants in Pakistan.

U.S. drone missiles have targeted areas near the Afghan border including North Waziristan, the main stronghold for various militant groups aligned with al Qaida and the Taliban, since 2004. Pakistanis have been angered by reports of civilian casualties and what they see as an abuse of their sovereignty.

It is unclear if, in their face-to-face talks, Sharif asked Kerry to halt the drone attacks.

But when asked at a news conference whether Pakistan wanted the U.S. to curtail the strikes, his foreign affairs adviser, Sartaj Aziz, replied: “We are asking them to stop it, not just curtail it.”

Meanwhile, Kerry said he expected the United States and Afghanistan to complete a security agreement that would allow American forces to stay in Afghanistan after 2014.

“I am personally confident that we will have an agreement,” Kerry said during a visit here.

Kerry’s comments appeared intended to reassure the Afghanistan and Pakistan governments that America was not abandoning the region.

Several prominent U.S. lawmakers have criticized the White House for failing to say how many troops it plans to keep in Afghanistan after 2014 and even stating that the White House has been considering pulling out all forces from there — the so-called “zero option.” That approach, they have argued, has backfired by heightening insecurity in Afghanistan.

Kerry declined to say what issues remained to be settled in the talks over the Bilateral Security Agreement, as the accord that is being worked out by the United States and Afghanistan is known.

Nor did he indicate when President Barack Obama would decide how many troops should remain in Afghanistan. But Kerry said he expected that American forces would remain, along with troops from allied countries, to train Afghanistan’s forces and carry out commando raids against terrorist groups as it takes over security of the country from coalition troops.

“The United States is drawing down, not withdrawing,” Kerry said. “So I am very hopeful that this is a transition, not an ending.”

Kerry’s visit to Pakistan, which was not announced in advance, was the first high-level visit since Pakistan’s new prime minister, Nawaz Sharif, took office.

Sharif’s election was the first time in Pakistan’s tumultuous history that a civilian Pakistani government has followed another civilian government that had served its entire term — a development Kerry portrayed as a march toward democracy.

The United States’ relationship with Pakistan has been a difficult one. But Kerry noted that he has invited Sharif to come to Washington and meet with Obama, stressing that the two sides both want improved relations.

“What was important today was that there was a determination by the United States and by Pakistan to move this relationship to the full partnership that it ought to be, and to find the ways to deal with individual issues that have been irritants over the course of the past years,” Kerry said.