Afghanistan hanged six prisoners convicted of terrorism offences, as President Ashraf Ghani carried out a threat to approve executions as part of a tougher new policy toward the Taliban.

The death sentences, carried out at the Pule Charkhi prison on the outskirts of Kabul on Sunday, underlined the harder line pursued by the government since a suicide attack claimed by the Taliban last month killed at least 64 people in Kabul.

A statement from Ghani's office on Sunday said the executions had been carried out after a fair and transparent legal process and in accordance with both the constitution and Islamic law.

"Considering repeated pleas from the families of victims of terrorist attacks, President Ghani signed off on death penalties for six who committed major crimes, crimes against civilians and public security," the statement said.

There was no indication of any direct link between the crimes and the April 19 Kabul attack.

With fiercer fighting expected in the coming weeks following the conclusion of the annual opium harvest, the decision to execute the prisoners further dims the hopes of reviving the stalled peace process backed by foreign partners including the United States and China.

Even before the executions, the Taliban had threatened "serious repercussions" if the threat were carried out, saying judicial institutions and individuals connected with the decision would be considered legitimate military targets.

It also said that foreign nationals and Afghan soldiers held as prisoners by the Taliban would be in danger.

"If the enemy decides to follow through with its announced intent and fails to restrain itself, then our judicial bodies could also contemplate over handing ultimate penalties in accordance with Islamic principles," it said last month.

The Taliban, which controls more territory in Afghanistan than at any time since it was driven from power by U.S.-led forces in 2001, has pledged to step up its campaign against the Western-backed government in Kabul this year.

Last month, it launched its spring offensive with a concerted attack on Kunduz, the northern city its forces captured briefly last year, as well as the biggest single suicide attack in Kabul since 2011.

The attack on a compound used by a branch of the security services employed to provide close protection to senior Afghan politicians, killed at least 64 service personnel and civilians and wounded hundreds of others.

It provoked a furious response from Ghani, who said Afghan security forces would launch an all-out offensive on elements of the Taliban that rejected peace.