Afghanistan President Ashraf Ghani has signed a decree to release 1,500 Taliban prisoners to begin direct talks with the insurgent group, aimed at ending the 18-year-long war in the country, Reuters reported on Wednesday.

The two-page decree said that all released prisoners need to give a written guarantee that they will not return to the battlefield. It also laid down the details of how the prisoners will be released. “The process will be completed within 15 days, with 100 prisoners walking out of Afghan jails every day,” the decree said.

According to the decree, talks between the Taliban and the Afghan government to end the war will run parallel to the release of prisoners. The government said it will release 5,000 Taliban prisoners in total if the talks make progress. Taliban said they will honour the deal by handing over 1,000 government troops.

On Tuesday, the United Nations Security Council adopted a resolution welcoming the accord between the US and the Taliban to bring peace to war-torn Afghanistan and allow US troops to return home from America’s longest war, PTI reported.

Earlier this month, the Taliban had said that they were resuming operations against Afghan security forces, ending the partial truce that preceded the signing of an accord between the United States and insurgents in Qatar in February, AFP reported.

Under the agreement, the United States 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 under the deal to work with allies to proportionally reduce the number of coalition forces in Afghanistan over that period, if the Taliban forces adhere to their security guarantees and ceasefire.

A full withdrawal of all US and coalition forces would occur within 14 months, Washington and Kabul had said in a joint statement. The Afghan war has been in stalemate for more than 18 years, with Taliban forces controlling or contesting more territory yet unable to capture and hold major urban centres. The US has spent over $750 billion in Afghanistan after the terror attacks of September 11, 2001, left nearly 3,000 people dead in New York.

The agreement also called for up to 5,000 Taliban prisoners to be released in exchange for up to 1,000 Afghan government captives by March 10. Ghani had rejected that demand.