Taliban officials said U.S. negotiators on Saturday agreed on a draft peace deal setting out the withdrawal of foreign troops from Afghanistan within 18 months, potentially ending the United States' longest war.

The details of the draft were given to Reuters by Taliban sources at the end of six days of talks with U.S. special peace envoy Zalmay Khalilzad in Qatar aimed at ending the war, more than 17 years since American-led forces invaded Afghanistan.

It stipulates that troops would leave within 18 months of the agreement being signed.