The Taliban will not take part in intra-Afghan talks until about 5,000 of its prisoners are released, a spokesman said Monday, presenting a major possible barrier to ending the war.

Under an accord between the U.S. and Taliban signed on Saturday, the two sides are committed to working towards the release of combat and political prisoners as a confidence-building measure. The agreement calls for up to 5,000 jailed Taliban prisoners to be released in exchange for up to 1,000 Afghan government captives by March 10. Afghan President Ashraf Ghani, not involved in the talks, has since rejected that demand.

"We are fully ready for the intra-Afghan talks, but we are waiting for the release of our 5,000 prisoners," Taliban spokesman Zabihullah Mujahid told Reuters by phone. "If our 5,000 prisoners, 100 or 200 more or less does not matter, do not get released there will be no intra-Afghan talks."

The Afghan war has been a stalemate for more than 18 years, with Taliban forces controlling or contesting more territory yet unable to capture and hold major urban centers. Under the agreement, the U.S. is committed to reducing the number of its troops in Afghanistan to 8,600 from 13,000 within 135 days of signing. It also is committed to working with allies to proportionally reduce the number of coalition forces in Afghanistan over that period, if the Taliban adhere to their security guarantees and cease-fire. A full withdrawal of all U.S. and coalition forces would occur within 14 months, a joint statement said. The withdrawal depends on security guarantees by the Taliban.