US in partial Afghanistan security deal
The US and Afghanistan say they have resolved disagreements on a bilateral security deal after lengthy talks in Kabul, although differences remain.
President Hamid Karzai said they had not reached agreement over immunity for US soldiers who stay in Afghanistan after next year's Nato withdrawal.
US Secretary of State John Kerry said Afghan sovereignty would be respected.
The talks were overshadowed by a US operation to capture a senior Pakistani Taliban commander.
Latif Mehsud was reportedly seized in eastern Afghanistan after talks with Afghan intelligence officers over a mooted prisoner-swap deal, and his capture is said to have angered President Karzai.A question of jurisdiction
In the partial bilateral security deal due to take effect next year, Mr Karzai appeared to have secured a US agreement not to carry out attacks on Afghan soil without first consulting the Afghan authorities.
The deal will help determine whether US troops will remain in Afghanistan after the main foreign combat forces pull out at the end of 2014.
While the exact terms have not yet been revealed, they failed to resolve the contentious issue of who has jurisdiction for any crimes committed by US forces remaining in Afghanistan after 2014.
President Karzai said it would be considered later by a grand council of elders and then parliament.
But Mr Kerry said if no deal on the issue was reached, there would be no agreement to allow US troops to remain in the country after the Nato-led mission ended in 2014.
The failure to resolve this issue in Iraq led to a total withdrawal of US forces.
The BBC's David Loyn says President Karzai failed to win security guarantees so that Afghanistan would be protected by US troops from external attack.
The US will not grant that as it could mire them in a war with Pakistan, he adds.
The long-awaited deal comes after two days of talks, with John Kerry extending his stay to try to reach consensus on the two major sticking points of jurisdiction and US counter-terrorism operations in Afghanistan.
A failure to provide a security deal could have an impact on the future of flows of non-military aid. Norway has already cut contributions over Afghan failure to make progress on human rights.
The Afghan government has made overtures for peace with the Taliban, freeing a number of Taliban prisoners to smooth over the process.
US and Pakistan media reports that Kabul was trying to recruit Letif Mehsud to operate as a go-between for peace talks with the Taliban.
He was recently made the right-hand man of Pakistani Taliban leader, Hakimullah Mehsud, and was acting as a negotiator in talks with other militia leaders, reports say.
The chief loosely controls more than 30 militant groups in Pakistan's tribal areas.
US attempts in June to talk to the Afghan Taliban, including the opening of a now-shut Taliban office in Qatar, infuriated Mr Karzai.