Pakistan assured Britain's visiting prime minister on Sunday that it would promote peace efforts in neighbouring Afghanistan as the West pushes for talks with the Taliban ahead of NATO's withdrawal.
David Cameron's talks in Islamabad were conducted as three attacks in northwest Pakistan killed at least 25 people, underscoring the Islamist militant violence plaguing both sides of the Afghan border.
Cameron's two-day visit to Afghanistan and Pakistan was part of a Western push to end a 12-year Taliban insurgency after recent efforts to start peace talks collapsed in ignominy over the manner in which the militants opened an office in Qatar on June 18.
Later Sunday Cameron flew to Kazakhstan as part of a trade mission, on the first ever trip to the country by a serving British prime minister.
The West considers Pakistani support vital to any peace deal in Afghanistan although relations between Kabul and Islamabad are traditionally mired in distrust.
Apparent headway between Pakistani President Asif Ali Zardari and Afghan leader Hamid Karzai at a summit hosted by Cameron in February has since unravelled in a series of public rows.
"We hope that the UK will continue these efforts to seek sustainable peace and stability in Afghanistan," said new Pakistani Prime Minister Nawaz Sharif after meeting Cameron.
He echoed Karzai's position that any peace process should be "Afghan-owned and Afghan-led". Karzai is hostile to any contacts with the Taliban that sidestep his administration in Kabul.
"I have assured Prime Minister Cameron of our firm resolve to promote the shared objective of a peaceful and stable Afghanistan, to which the three million Afghan refugees currently living in Pakistan can return with honour and dignity," said Sharif.
Cameron said he welcomed Sharif's remarks about the "vital importance of the relationship between Pakistan and Afghanistan".
"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, and I know that you and President Karzai will work together towards those ends," Cameron said.
The search for a peace deal is an urgent priority as 100,000 US-led NATO combat troops prepare to withdraw next year and Afghan forces take on the fight against insurgents.
The Taliban office in Qatar that opened on June 18 was meant to foster talks but instead enraged Karzai, who saw it as being styled as an embassy for a government-in-exile.
He broke off bilateral security talks with the Americans and threatened to boycott any peace process altogether.
On Sunday the Afghan government said the security talks with the US, over a pact that would allow some troops to stay in Afghanistan after 2014, "can resume when the talks between the HPC (High Peace Council) and the Taliban begin".
But the Taliban have consistently refused to meet the HPC, the official negotiators of the Afghan government, saying Karzai is a puppet of the United States.
Cameron is the first head of government to visit Pakistan since Sharif took office after elections that marked an historic democratic transition in a state long ruled by the army.
He congratulated Sharif on his victory in the May 11 polls and called the transition of democratic power "something of a golden moment for Pakistan and for her people".
Both sides pledged to increase trade between Britain and Pakistan to a target of three billion pounds ($4.56 billion) by 2015.
Sharif has inherited a raft of massive problems, not least a moribund economy and a desperate energy crisis.
He told Cameron his government was taking "austerity measures... to ensure fiscal discipline and address the challenge of energy shortages" and welcomed British development and trade.
On Sunday, a car bomb targeted a Pakistani security forces' convoy in a marketplace near the main northwestern city of Peshawar, killing 17 people and wounding 46 others, mostly civilians.
Two other attacks in the northwest killed a total of eight people.
Another attack in the Hazara town area of the volatile southwestern city of Quetta saw 28 people killed when a suicide bomber tried to blow up a Shiite Muslim mosque. Hazara town has been a flashpoint for attacks on Shiites and the minority Hazara ethnic group.
There was no immediate claim of responsibility for the Peshawar bombing. But the Pakistani Taliban frequently target security forces as part of a seven-year domestic insurgency that has killed thousands of Pakistanis.
Pakistan is on the frontline of the US-led war against Al-Qaeda and terror plots against the West have been hatched in its semi-autonomous tribal belt in the northwest.
Cameron said the battle against terrorism needed "a tough and uncompromising security response" as well as investment in education and tackling poverty.
Sharif said Pakistan was "resolved to tackle the menace of extremism and terrorism with renewed vigour and close cooperation with our friends".
On June 22 gunmen shot dead 10 foreign tourists and a Pakistani guide in an unprecedented attack at a remote base camp in the Himalayas that was claimed by Pakistan's umbrella Taliban faction.