Afghan authorities are opening prison doors for thousands of Taliban inmates in a high-risk gambit to ensure the insurgent group begins peace talks with Kabul.

Security concerns are mounting as several of the newly liberated fighters say they are ready to resume their holy war.

"If the Americans do not pull out, we will continue our jihad, because they have killed many Afghans in their operations," said Mohamed Daud, who was freed from Bagram jail north of Kabul last month.

"We do not want foreign forces in our country anymore," he told AFP, dressed in a traditional shalwar kameez, before taking a taxi back to his village with a cash handout from authorities worth $65.

US forces arrested Daud, 28, in the northwest province of Faryab nine years ago.

Afghan authorities have so far freed 3,000 Taliban inmates while the insurgents have released more than 750 government prisoners
Afghan authorities have so far freed 3,000 Taliban inmates while the insurgents have released more than 750 government prisoners AFP / Wakil KOHSAR

Afghan authorities accelerated the planned release of 5,000 Taliban prisoners, including Daud, as a "goodwill gesture" after the insurgents called a three-day ceasefire to mark the Eid holiday.

A security official said those flagged by the Taliban for release include aspiring suicide bombers, suicide vest makers, kidnappers and even foreign fighters.

The move is part of a larger prisoner swap agreed as a precursor to the start of peace talks.

Before their release, inmates were required to sign a pledge that they would not pick up arms again. It is increasingly clear such commitments mean little.

A Taliban commander in Pakistan told AFP there should be "no ambiguity" that the released men will eventually be deployed to Afghanistan's front lines.

Dozens of Taliban prisoners are freed during a historic ceasefire in Afghanistan -- only the second in nearly 19 years of war.  About 600 were set to be freed from the notorious Bagram jail near Kabul.
Dozens of Taliban prisoners are freed during a historic ceasefire in Afghanistan -- only the second in nearly 19 years of war. About 600 were set to be freed from the notorious Bagram jail near Kabul. AFPTV / Wakil KOHSAR

"It's an ongoing jihad, and will continue until and unless we reach some sort of agreement with the Kabul government," he said.

A Taliban spokesman who represents insurgent fighting forces did not respond to a request for comment, but the group's political spokesman Suhail Shaheen rejected claims prisoners would rejoin the fight, saying the Taliban had enough "active and reserve forces".

"We do not need any manpower in the battlefield, because we are entering the intra-Afghan negotiations," Shaheen told AFP.

Taliban prisoners prepare for their release from Bagram prison in Afghanistan
Taliban prisoners prepare for their release from Bagram prison in Afghanistan AFP / Wakil KOHSAR

Several freed insurgents say they remain angry at US troops, but under a US-Taliban deal signed in February, the insurgents committed to stop attacking American and foreign forces as they withdraw from the country by next year.

The immediate enemy is instead the struggling Afghan National Defence and Security Forces (ANDSF), with whom no such pledge has been made.

A key concession Washington extracted from the Taliban during negotiations was the requirement to begin peace talks with Kabul.

In return, the Afghan government must release 5,000 insurgent inmates while the Taliban pledged to free 1,000 security force prisoners.

Since the swap started, Afghan authorities have freed 3,000 Taliban inmates while the insurgents have released more than 750 government prisoners, officials said.

It could represent a boost of up to 10 percent for the Taliban, with estimates on the number of insurgents ranging between 50,000 and 100,000.

Afghan security officials said the US did not consult them before Washington and the Taliban finalised the prisoner swap.

More than the fighters, "those that worry us are the brains", a senior security official said, adding that one of the freed Taliban inmates had already joined the insurgents' military squad while another had committed a murder.

The Taliban heralded the US deal as proof they had defeated America in its longest war, and the bluster has only grown in recent months.

"Politics and negotiations should not be taken to mean that we will neglect jihadi affairs and the strengthening and development of our jihadi military force," Taliban deputy leader Sirajuddin Haqqani said in a recent broadcast.

The Taliban now find themselves in a win-win situation -- even if peace talks with Kabul fail.

With its key donor calling the shots, the Afghan government had no choice but to yield to Washington's demand to proceed with the exchange.

Still, some observers hold out hope for successful peace talks that would bring an end to Afghanistan's 19-year-old war.

"These talks hold a better hope for a lasting ceasefire than any other current approach," said Andrew Watkins, an analyst with International Crisis Group.

No start date has been set for the talks.