Former Taliban prisoner Army Sgt. Bowe Bergdahl has been charged with desertion.

The charges come after a lengthy investigation into the reason why Sgt. Bergdahl left his post, leading to his capture. His attorney claims Sgt. Bergdahl is innocent and a torture victim.

The U.S. military announced on Wednesday it had charged Sgt. Bergdahl with "Desertion with Intent to Shirk Important or Hazardous Duty" and "Misbehavior Before The Enemy by Endangering the Safety of a Command, Unit or Place" under the Uniform Code of Military Justice for his 2009 disappearance, according to a news release from the Pentagon.

In 2009, Sgt. Bergdahl left his unit in Afghanistan and was subsequently captured by the Haqqani terrorist network, allied with the Taliban. For the next five years he was held captive and was only released last year after a prisoner swap.

The military investigation into Sgt. Bergdahl's disappearance began after he arrived at Fort Sam Houston in Texas. The news release states the military will not release the findings of the investigation until after the judicial hearing.

An Article 32 hearing, to assess whether there is enough evidence to proceed to a court-martial, will be held at Fort Same Houston at a date yet to be announced. If the hearing finds enough evidence, the court-martial will go forward.

Both charges have a maximum punishment of dishonorable discharge, losing his rank, and losing his veteran benefits. However, the charge of "Misbehavior Before The Enemy by Endangering the Safety of a Command, Unit or Place" carries punishment of life in prison. The other charge carries a maximum of five years.

Following the announcement he had been charged, Sgt. Bergdahl's attorney, Eugene R. Fidell, released a statement objecting to the charges, reports CNN.

"In light of the nearly five years of harsh captivity Sgt. Bergdahl endured, the purpose of his leaving his unit, and his behavior while a prisoner, it would be unduly harsh to impose on him the lifetime stigma of a court-martial conviction or an other than honorable discharge and to deny him veterans benefits," he wrote in a letter to Gen. Mark A. Milley, commander of U.S. Army Forces Command.

Attached to his letter, Fidell provided a two-page account Bergdahl wrote detailing his capture and the torture, physical and psychological, he experienced at Taliban hands.

He explained he was chained, kept in a cage, malnourished, suffered infections, and was repeatedly threatened with death. However, Republicans and others remain skeptical the trade of five Taliban fighters for Sgt. Bergdahl was appropriate.

CNN reported earlier this year that it is believed at least one of the fighters released may have rejoined the Taliban. The administration, nonetheless, stands with its decision.

Appearing on Fox News, State Department spokesperson Jen Psaki defended the decision, calling it "absolutely" worth it, explaining the government has a responsibility to its soldiers to bring them home if possible.