This is an archived article and the information in the article may be outdated. Please look at the time stamp on the story to see when it was last updated.

Sgt. Bowe Bergdahl pleaded guilty to desertion and misbehavior before the enemy via his attorney Monday.

U.S. Army Sgt. Robert Bowdrie "Bowe" Bergdahl (right) is escorted into the Ft. Bragg military courthouse for a motions hearing on October 16, 2017 in Fort Bragg, North Carolina. Bergdahl faces charges of desertion and endangering troops stemming from his decision to leave his outpost in 2009, which landed him five years in Taliban captivity. (Credit: Sara D. Davis/Getty Images)
U.S. Army Sgt. Robert Bowdrie “Bowe” Bergdahl (right) is escorted into the Ft. Bragg military courthouse for a motions hearing on October 16, 2017 in Fort Bragg, North Carolina. Bergdahl faces charges of desertion and endangering troops stemming from his decision to leave his outpost in 2009, which landed him five years in Taliban captivity. (Credit: Sara D. Davis/Getty Images)

Bergdahl, 31, was charged after he disappeared from his base in Afghanistan in June 2009 and was held in captivity by the Taliban until May 2014.

A judge said Bergdhal’s maximum possible punishment would be life in prison, but he has not been sentenced yet.

After his capture, Bergdahl said he made “somewhere between a dozen and 15 escape attempts.”

The Taliban released Bergdahl in a prisoner swap for five detainees at Guantanamo Bay.

During questioning from a judge Monday, Bergdahl said, “I left my observation post on my own.” He also said, “I understand leaving was against the law.”

Bergdahl has been called both a traitor and a hero.

Celebrated at first, Bergdahl’s release raises more questions

Six soldiers’ deaths have been tied, either directly or indirectly, to the search for Bergdahl during his disappearance in Afghanistan, former unit members alleged.

Bowe Bergdahl: I wanted to be Jason Bourne

In 2015, an Army Sanity Board evaluation said, Bergdahl had schizotypal personality disorder. That information was included in the hundreds of pages of documents that Bergdahl’s defense team releases on a website called The Bergdahl Docket.

Check back for updates on this developing story.