Helping to bring stability to Afghanistan would be in Pakistan's interest, British Prime Minister David Cameron told his counterpart during a two-day visit in Islamabad.
"I profoundly believe that a stable, prosperous, peaceful, democratic Afghanistan is in Pakistan's interest just as a strong, stable, peaceful, prosperous and democratic Pakistan is in Afghanistan's interest," Cameron said on Sunday. "And I know that you [Nawaz Sharif] and President Karzai will work together towards those ends."
Cameron arrived in Pakistan for talks with newly-elected Sharif and President Asif Ali Zardari on Saturday, focusing on the Afghan peace process.
The British leader had come from Afghanistan, backing talks with the Taliban after his top general said the West missed a chance to strike a peace deal 10 years ago.
For his part, Sharif agreed, adding that the peace process should be "inclusive, Afghan-owned and Afghan-led."
He also used the opportunity to "assure" Cameron "of our firm resolve to promote the shared objective of a peaceful and stable Afghanistan, to which the 3 million Afghan refugees currently living in Pakistan can return with honour and dignity,"
Cameron, the first foreign government leader to visit Islamabad since Sharif took office in June after winning landmark elections in May, also met with Pakistani President Asif Ali Zardari.
Farhatullah Babar, a presidential spokesman, said Zardari "emphasised that Pakistan all along has maintained a constructive approach and believes that dialogue and reconciliation was the only war forward towards ensuring durable peace in Afghanistan".
"The president welcomed efforts being made for finding a peaceful solution to the long drawn conflict in Afghanistan. He expressed the hope that the efforts made would also take into account legitimate concerns of all the stakeholders," Babar said in a statement.
Cameron visited British troops in the Afghan southern province of Helmand earlier on Saturday and met President Hamid Karzai as Afghanistan and international powers try to revive peace efforts that recently collapsed in ignominy.
In February, Cameron hosted Zardari and Karzai to agree on a peace roadmap with the Taliban.
A Taliban office in Qatar that opened on June 18 was meant to foster talks but instead triggered a diplomatic bust-up when the Taliban used the title of the "Islamic Emirate of Afghanistan" from their 1996-2001 reign.
Karzai, furious that the office was being styled as an embassy for a government-in-exile, broke off bilateral security talks with the Americans and threatened to boycott any peace process altogether.
Only hours after the Qatar office opened, a Taliban rocket attack killed four Americans on the largest military base in Afghanistan.
Days later, a suicide squad targeted the presidential palace and a CIA office in the most audacious assault in Kabul in years.
Peace talks with the Taliban were previously anathema to many Western leaders, with Cameron's predecessor Gordon Brown vowing in 2007 that Britain "will not enter into any negotiations with these people".