KABUL (Reuters) – Afghanistan agreed on Sunday to release 400 “hard-core” Taliban prisoners, paving the way for peace talks aimed at ending almost two decades of war.

Under election-year pressure from U.S. President Donald Trump for a deal allowing him to bring home American troops, the war-torn country's grand assembly, or Loya Jirga, on Sunday approved the release, a controversial condition raised by the Taliban militants to join peace talks.

“In order to remove an obstacle, allow the start of the peace process and an end of bloodshed, the Loya Jirga approves the release of 400 Taliban,” the assembly said in a resolution.

Minutes later, Afghan President Ashraf Ghani announced, “Today, I will sign the release order of these 400 prisoners.”

Related: SECDEF Esper: US will cut troop levels in Afghanistan to 'less than 5,000'

Last week Ghani invited some 3,200 Afghan community leaders and politicians to Kabul amid tight security and concerns about the COVID-19 pandemic, to advise the government on whether the prisoners should be freed. 

Among the 400 are Taliban members accused of major attacks against civilians and foreigners, including a 2017 truck bombing near the German embassy in Kabul that killed more than 150 – the deadliest attack in the 19-year insurgency. Taliban and official sources have told Reuters the group includes members of the militant Haqqani network, which has ties to the Taliban. 

With the release, the Afghan government will fulfil its pledge to release 5,000 Taliban prisoners.

Talks between the warring Taliban and government will start in Doha this week, Western diplomats said. Ghani appealed to the hardline Islamist group to pledge to a complete ceasefire ahead of talks.

Afghanistan photo

The Taliban have not commented on the decision to release the remaining prisoners.

Deliberation over the release of last batch of Taliban prisoners, accused of conducting some of the bloodiest attacks across Afghanistan, had triggered outrage among civilians and rights groups who questioned the morality of the peace process.

It has also proved wrenching for the families of the more than 100,000 Afghan civilians thought to have been killed or injured in the past decade, more than 10,000 last year alone. The Loya Jirga had urged the government to seek forgiveness from the families for their killers, important under many interpretations of Islamic law.

Sunday's decision caps more than five months of fitful talks after Washington and the Taliban agreed on the release of the Taliban prisoners as a condition for the talks with Kabul. 

U.S. officials had encouraged the Loya Jirga in recent days to support the release of the prisoners despite the drawbacks in order to get the peace process moving. 

Related: US government officials are encouraged to lie about progress in Afghanistan, special inspector general says

Neighbouring Pakistan, seen as key to helping pave the way to talks, welcomed Sunday's decision.

“We hope that with implementation of this step relating to the prisoners’ release, as envisaged in the U.S.-Taliban Peace Agreement, the Intra-Afghan Negotiations will commence at the earliest,” Pakistan's foreign office said in a statement.

Ahead of the Loya Jirga, Human Rights Watch cautioned that many of the prisoners had been jailed under “overly broad terrorism laws that provide for indefinite preventive detention”.

With November elections looming, Trump, behind in the polls, is eager to fulfil a major campaign promise to end America's longest war.

The drawdown will bring the number of U.S. troops to “a number less than 5,000” by the end of November, Defense Secretary Mark Esper said in an interview broadcast on Saturday, down from current levels of around 8,600.

 (Reporting by Hamid Shalizi and Hameed Farzad in Kabul; Additional reporting by Alexander Cornwell in Dubai and Charlotte Greenfield in Islamabad; Writing by Gibran Peshimam and Rupam Jain; Editing by William Mallard)

Related: Trump reiterates that he wants to end the Afghanistan war and ‘bring our troops back home’