U.S. Secretary of State John Kerry left Afghanistan late Saturday after two days of talks with Afghan President Hamid Karzai.
The top U.S. diplomat and the Afghan leader said after their talks they were closer to an agreement on bilateral security, but differences remain over the question of immunity for U.S. troops.
The two officials commented in Kabul following extended talks on a possible U.S. presence in Afghanistan after the NATO-led military mission ends next year.
President Karzai said the question of which country had jurisdiction over any crimes committed by U.S. forces after 2014 would have to be resolved by the Afghan parliament and an assembly of elders.
Kerry said the U.S. could prosecute any wrongdoing by American forces.
The U.S. has been pushing for an agreement with Afghanistan by the end of this month.
The talks between Washington and Kabul have been in progress for over a year.
However, they have repeatedly stalled on issues of Afghan sovereignty, the expected role of U.S. forces, and Mr. Karzai's demand for American guarantees against future foreign intervention. If there is no agreement, U.S. forces will leave by the end of 2014.