KANDAHAR, Afghanistan – The Taliban on Friday released a video purportedly showing US soldier Bowe Robert Bergdahl, who was captured in Afghanistan about six months ago.

A spokesman for the hardline Islamist group said it was demanding the release of prisoners from US detention centres in exchange for Bergdahl's freedom.

The 36-minute video features Bergdahl, 23, in various poses including one in front of a carpet, wearing combat fatigues, a helmet and sunglasses, and another where he is seen shaven-headed and in grey robes.

The clip also shows news footage of US political leaders, Taliban military action, some graphic pictures of what appears to be civilian casualties and apparent abuse of prisoners at US detention facilities.

"I'm afraid to tell you that this war has slipped from our fingers and it's just going to be our next Vietnam unless the American people stand up and stop all this nonsense," Bergdahl is shown saying on the video.

Bergdahl, a private first class who disappeared in southeastern Paktya province on June 30, is the first US soldier to be captured in Afghanistan since the US-led invasion in 2001.

In the video, Bergdahl gives details about himself such as his rank, date and place of birth and other family information, as well as deployment details and how he is being treated by his captors.

"I bear witness, I was continuously treated as a human being with dignity. I had nobody deprive me of my clothes and take pictures of me naked, I had no dogs barking at me and biting me as my country has done to the Muslim prisoners in the jails that I mentioned," he said in the video.

There was no immediate comment from the US military or NATO forces in Afghanistan about the video.

"We are ready to release him in exchange for the release of our prisoners but the Americans are not ready to release our prisoners in exchange for their soldier," Taliban spokesman Yousuf Ahmadi told AFP.

"He is not being tortured or tormented. He is being dealt with according to sharia teachings of a war hostage," Ahmadi added, without saying what would happen if the Taliban demands were not met.

The Taliban issued another video of Bergdahl in July, showing a visibly shaken, shaven-headed soldier pleading for US troops to leave Afghanistan.

Ahmadi said the second video was released to show the world that the Taliban had gained the upper hand in the war.

"We want to show to the world that this is an invasion of Afghanistan, they are invaders, we want to show we are winning this war and the invaders will be either killed or captured like this."

It was not clear when the video was made.

In July, a man claiming to be a local Taliban commander told AFP that Bergdahl had been taken across the border to Pakistan, where the Taliban are also waging an insurgency.

But Ahmadi insisted Bergdahl was being kept inside Afghanistan and had never been taken to Pakistan. Such claims are impossible to verify.

On July 2 a commander of the Taliban's Al-Qaeda-linked Haqqani faction, which is active in the southeastern border provinces of Paktya, Paktika and Khost, claimed the abduction.

In the latest video, Bergdahl warns soldiers who are about to be deployed to Afghanistan what to expect on the battlefield.

"So, (to) all you soldiers that are getting ready to come over here for their first time because of the stupidity of our country, our leaders: no, you are not fighting stupid farmers.

"No, you are not fighting a small group of terrorist guerrilla fighters. You are fighting an organised guerrilla army that has perfected guerrilla warfare better than any country has ever perfected it in history.

"You're not fighting stupid people. You are fighting very smart people who know exactly how to kill us and are extremely patient and know how to wait for the right moment. So, stop believing illusions," he added.

It was impossible to verify whether Bergdahl was coerced into making the statements.

In July, US Secretary of State Hillary Clinton denounced Bergdahl's capture as "outrageous" and said the United States was doing everything it could to free him.

More than 500 US and foreign soldiers have been killed in Afghanistan so far this year in the battle against an escalating Taliban-led insurgency.