The US secretary of state has left Afghanistan after failing to reach a full agreement over the withdrawal of US troops next year.
John Kerry said on Saturday in Kabul that despite agreeing with Afghan President Hamid Karzai on a set of core elements in a deal that would allow troops to remain on in Afghanistan, both sides were unable to iron out the crucial issue of immunity for US troops stationed in the country.
"We need to say that if the issue of jurisdiction cannot be resolved, then unfortunately there cannot be a bilateral security agreement," Kerry said.
Karzai said the talks had focused on protecting Afghan sovereignty and that major differences had been resolved, including a US request to run independent counterterrorism missions in the country.
Such operations carried out by the US have long infuriated the Afghan president, who had been demanding Washington agree to share intelligence instead.
Karzai said the US snatching of a senior Pakistani Taliban commander was an example of the kind of action that Afghanistan wanted to avoid.
"This is an issue that we have raised in earnest with the United States in the past few days as we have all previous occasions of such arrests in which the Afghan laws were disregarded," Karzai said, referring to the capture of commander Latifullah Mehsud.
"Therefore our discussion today in particular has been focused on making sure that through the bilateral security agreement such violations are not repeated."
Kerry attributed the complaint to a misunderstanding. "We followed the normal procedures that the United States follows ... we did what we are supposed to do," he said.
Karzai said the US proposal will be now put forward to the country's Loya Jirga, an assembly of elders, leaders and other influential people, to decide.
| Our complete Afghanistan coverage
The Afghan government rejected an initial US proposal on immunity at the start of the year and it has been a sticking point ever since.
The failure to reach a deal could prompt the US to pull all its troops out after 2014, in an outcome known as the "zero option".
The collapse of similar talks between the US and Iraq in 2011 - partly over the issue of immunity - led to the US completely ending its forces' mission there rather than maintaining a significant presence.
US officials had said earlier that Kerry did not intend to close a deal on the Bilateral Security Agreement (BSA) during the visit, but the US is concerned that as Afghan election campaigning intensifies, it will be harder to broker a deal.
Currently, there are 52,000 American troops in Afghanistan and the US wants to keep as many as 10,000 soldiers in the country.