Washington- US soldier Bowe Bergdahl, who was held captive by the Taliban for five years, appeared smiling alongside an alleged Haqqani commander in a photo posted on a Twitter account purporting to be from the Afghan Taliban.

The account, which posted the photo along with others of Bergdahl as well as gruesome images of a decapitation, said the soldier was treated with kindness in captivity. "Bowe #Bergdahl was really impressed when he saw the hospitality of #Taliban He first thought that he will be tortured but he was wrong," the Twitter post said. "He was not shackled in Chains neither was he Tortured, Rather He was Free."

Bergdahl was captured on June 30, 2009, in unclear circumstances. He was released on May 31 in a prisoner swap that freed five Taliban leaders held at Guantanamo prison in Cuba. He has not spoken to the media since his release and the Twitter account's description of his time in captivity could not be confirmed.

A Taliban official told NBC News the rebel group did not own the Twitter account that posted the picture, but that it was run by a known sympathizer who worked at an Afghan university and had copied the photo from the militants' Facebook accounts. The picture is tagged with the words "Jundul Haqqani", or Haqqani group.

The Twitter account identified the man in the photo with Bergdahl as Badruddin Haqqani, head of operations and financial chief for the Haqqani network. The insurgent group is blamed for some of the deadliest and most spectacular attacks on NATO and Afghan troops in Afghanistan. A drone strike killed Badruddin Haqqani in 2012 in northwestern Pakistan.

Bergdahl's release sparked an initial wave of euphoria in the United States that quickly became overwhelmed by a bitter political debate over whether he had abandoned his post and whether the prisoner swap should have gone ahead. Some of his former colleagues have called for him to be court-martialed for allegedly deserting his post.

US Defense Secretary Chuck Hagel said the army was investigating the circumstances of Bergdahl's disappearance. He was the only US soldier to be captured and held hostage during the war in Afghanistan. Bergdahl was initially flown to a US hospital in Germany. Last month he arrived back on US soil, and has been housed at a military hospital in San Antonio, Texas, to help him readjust.

The hospital facility, formally known as the San Antonio Military Medical Center, has teams of specialists and has been helping returning prisoners of war for decades.