David Cameron issued a direct appeal to the Taliban to enter peaceful talks on the future of Afghanistan after hosting talks at Chequers with Afghan president Hamid Karzai and Pakistani president Asif Ali Zardari today.
The prime minister said the two leaders had agreed "an unprecedented level of co-operation".
He said they had agreed to sign up to a strategic partnership between their two countries in the autumn.
At the same time, they also agreed to the opening of an office in the Qatari capital Doha for negotiations between the Taliban and the Afghan High Peace Council.
Cameron said the agreement should send a clear message to the Taliban.
"Now is the time for everyone to participate in a peaceful, political process in Afghanistan," he said.
He added: "This should lead to a future where all Afghans can participate peacefully in that country's political process."
Karzai said that they had had a "very frank and open discussion" and echoed Cameron's appeal to the Taliban to join peace talks.
He said that he hoped relations with Pakistan - which have been strained in the past - could in future be "very close, brotherly and good neighbourly".
Zardari said that Pakistan would fully support any dialogue with the Taliban.
"Peace in Afghanistan is peace in Pakistan. We feel that we can only survive together," he said.
"We cannot change our neighbourhood or our neighbours."
A joint statement issued following the talks said that Karzai and Zardari had agreed arrangements to strengthen co-ordination of Taliban detainee releases from Pakistani custody in support of the peace process.
The talks, in the secluded surrounds of the Prime Ministers official country retreat, were attended by senior military and intelligence figures including the UK chief of the defence staff, General Sir David Richards, and MI6 chief Sir John Sawers.
With British and other foreign forces preparing to withdraw next year, Cameron said that it was in all three countries' interest to achieve stability in Afghanistan.
"We share the same vision for Afghanistan - a secure, stable, democratic country that never again becomes a haven for terrorism," he said.
"Clearly there is much more work to be done in the months ahead and the United Kingdom will continue to stand firmly behind both countries as they work together to bring stability to the region."
Before the talks, Karzai said peace required the involvement in talks of "external elements involved in creating instability and fighting" in his country.
But he told The Guardian and ITN that he was more optimistic than a year ago that behind-the-scenes discussions between his government and the Taliban would prove fruitful.
He said he expected fighting in his country to diminish when foreign troops have gone as it will remove a grievance which drove many to take up arms.
"The exit of foreign forces will not bring more violence for them to perpetrate against their own people, but a serious, strong, good reduction in violence will occur," he said.