Afghanistan has freed the first batch of Taliban prisoners out of a final 400 whose release will pave the way for negotiations between the warring sides in the country's protracted conflict, the government said on Friday. Javid Faisal, spokesman for the Afghan National Security Council, said 80 prisoners were released on Thursday while Taliban officials said 86 prisoners were freed. It was not immediately known when the remaining prisoners would be released. Prisoner releases on both sides are part of an agreement signed in February between the United States and the Taliban to end the 19-year-old war. It calls for the release of 5,000 Taliban held by the government and 1,000 government and military personnel held by the insurgent group as a good will gesture ahead of intra-Afghan negotiations. Talks are expected to be held in Qatar where the Taliban maintain a political office. Several Afghan leaders told The Associated Press talks could begin by August 20. The negotiations are to lay out a framework for a post-war Afghanistan. Washington's peace envoy Zalmay Khalilzad spent a year and a half negotiating the peace deal aimed at allowing American troops to return home and end America's longest military engagement. US troops have already begun leaving and by November less than 5,000 troops are expected to still be in Afghanistan, down from nearly 13,000 when the agreement was signed February 29. American and Nato troop withdrawal is contingent on the Taliban keeping their commitment not to allow militant groups to use Afghanistan against the US or its allies. The withdrawal is not tied to successful talks between the warring sides. Last weekend, Afghan President Ashraf Ghani held a traditional council meeting known as a loya jirga to get a consensus on the release of a final 400 Taliban he said were accused of serious crimes, saying that he could not unilaterally decide to release them. Some of the 400 have been implicated in devastating bombings in the capital Kabul. During a televised talk on Thursday with the US-based Council on Foreign Relations, Mr Ghani warned of dangers they could present to lasting peace in Afghanistan. But for some in Afghanistan the talks with the Taliban mirror earlier negotiations with other insurgents, including warlord and US-designated terrorist Gulbuddin Hekmatyar, who many say has a reputation for violence that exceeds the Taliban. In 2016, Mr Ghani negotiated a peace deal with Mr Hekmatyar, whose Hezb-e-Islami group took responsibility for several bombings in Kabul, including one at a grocery story in the capital that killed a young family. The deal included removing Mr Hekmatyar from the UN terrorist list. His group was also responsible for a 2008 attack on French soldiers – the largest international loss in a single battle in Afghanistan. Also on Friday, a small bomb hidden in a motorcycle exploded near a mosque in Kabul just as worshippers were finishing their prayers, wounding a police officer. No one immediately took responsibility but ISIS has in the past targeted mosques in Afghanistan. The ISIS affiliate in Afghanistan has been targeted by Afghan security forces, US troops and the Taliban. A US Department of Defence official previously said the peace deal with the Taliban was also intended to recruit the insurgent group into a co-ordinated fight to rid the region of ISIS. Meanwhile, the Afghan Defense Ministry said it was investigating a video circulating on social media purporting to show Afghan army personnel mutilating Taliban corpses. The United Nations Mission in Afghanistan tweeted that the footage “is deeply shocking ... investigation needs to be swift and open. If crimes are proven the criminals must be identified and held responsible."