The Afghan government agreed on Sunday to release 400 "hard-core" Taliban prisoners, paving the way for peace talks aimed at ending almost two decades of war.
The insurgent group welcomed the move and said it was ready to begin talks within 10 days of the release.
Under election-year pressure from US President Donald Trump for a deal allowing him to bring home American troops, the country's grand assembly, or Loya Jirga, on Sunday approved the release.
The Taliban militant had demanded the release of the 400, the last batch among 5,000 prisoners to be freed, as a condition 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, President Ashraf Ghani announced, "Today, I will sign the release order of these 400 prisoners."
Last week Ghani invited the grand assembly, some 3,200 community leaders and politicians, to Kabul 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 people - 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 government and the Taliban 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.
But while the Taliban agreed to start talks within 10 days of the release, it did not commit to an immediate ceasefire.
"Ceasefire is and will be an important part of the talks, which will be decided during talks (not before)," Taliban spokesman Suhail Shaheen told Reuters on the phone from Doha, where the group's political office is based.
Sunday's government decision capped 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.
Deliberation over the release of last batch of Taliban prisoners had triggered outrage among civilians and rights groups.
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 of those killed in attacks carried out by the Taliban prisoners being released, important under many interpretations of Islamic law.
US officials had encouraged the Loya Jirga in recent days to support the prisoners' release despite the drawbacks in order to get the peace process moving.
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 US-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 the Nov. 3 presidential election looming, Trump is eager to fulfil a major campaign promise to end America's longest war.
The drawdown will bring the number of US 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.