WASHINGTON :  An American soldier who was held captive by Afghan insurgents for nearly five years is returning to military duty after more than a month of counseling, the US Army said Monday.

Following his release on May 31 in a swap with the Taliban, Sergeant Bowe Bergdahl underwent medical examinations and counseling at a military hospital in San Antonio, Texas to prepare him for “reintegration” into the army.

“He will now return to regular duty within the command where he can contribute to the mission,” the army said in a statement.

Bergdahl will be assigned to Joint Base San Antonio-Fort Sam Houston in Texas, the army said. It was not clear what role or tasks he would be given.

An investigation into the circumstances of his disappearance and capture “is still ongoing,” the army said.

The 28-year-old soldier has yet to speak to the media since his release and army officials acknowledged they provided him with advice on dealing with journalists over the past month, which they said was standard practice for former prisoners of war.

Bergdahl, the only American in uniform to be held by insurgents in the Afghanistan war, spent nearly five years in captivity at the hands of Taliban-linked Haqqani insurgents after he went missing from his post in eastern Afghanistan near the Pakistani border in June 2009.

During his time at the Texas military hospital, counselors tried to help Bergdahl shift away from a prisoner’s survival mentality, officials said.

President Barack Obama has come under intense criticism from some lawmakers over the swap that freed Bergdahl.

Republicans say the administration made a dangerous concession by agreeing to the transfer of five senior Taliban figures to Qatar from the US-run prison at Guantanamo Bay, Cuba.

There has long been speculation that Bergdahl may have deserted his post, with some soldiers in his unit alleging he walked away alone.

Former army specialist Cody Full, who served in the same squad in Blackfoot Company as Bergdahl, told lawmakers last month that Bergdahl was a conflicted soldier who carried out a “pre-meditated” plan to abandon his post.

“He didn’t understand why we were doing more humanitarian aid drops, setting up clinics, and helping the populous instead of hunting the Taliban,” Full told a House Foreign Affairs panel.

Bergdahl was a “good soldier” during training in California, but shortly after arriving in Afghanistan he started voicing disagreement with the way missions were conducted, Full said.

The Obama administration has defended its handling of the case, saying the government has an obligation to bring all US soldiers home and that an investigation will show if Bergdahl violated his orders or duties.

Some retired soldiers have alleged that several troops died in search efforts for Bergdahl, but the Pentagon has said there is no evidence to support that charge.