US Secretary of State John Kerry has extended talks with Afghan President Hamid Karzai over the contentious security deal to allow American troops to remain in the country after the Nato-led military mission ends next year.

Talks on a bilateral security agreement that the United States wants by the end of October were extended by at least two hours and a spokesman for Mr Karzai's office said they would go on until this afternoon.

US officials said some progress had been made but it was unclear if that was the reason for the continued talks.

Mr Kerry's unannounced overnight visit to Kabul comes as talks foundered over issues of Afghan sovereignty despite a year of negotiations. Discussions have repeatedly stalled in recent weeks over Mr Karzai's demand for American guarantees against future foreign intervention from countries like Pakistan, and US demands for any post-2014 residual force to be able to conduct counterterrorism and counterinsurgency operations.

The agreement is necessary to give the US a legal basis for having forces in Afghanistan after the end of 2014 and also allow it to lease bases around the country. It would be an executive agreement, meaning the US Senate would not have to ratify it.

There currently are an estimated 87,000 international troops in Afghanistan, including about 52,000 Americans. That number will be halved by February and all foreign combat troops will be gone by the end of next year.

The US wants to keep as many as 10,000 troops in the country to go after the remnants of al Qaida, but if no agreement is signed, all US troops would have to leave by December 31, 2014.

Mr Karzai is calling a meeting of Afghan tribal elders in November to advise him on whether to sign a security deal.

If they endorse the agreement, then he has political cover to agree to it. He is keenly aware that previous leaders of his country historically have been punished for selling out to foreign interests and wants to make sure that any US-Afghan agreement is not seen in that light.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.