Story highlights Bergdahl said he deserted to try to report a critical problem in his command

He was captured by the Taliban hours after leaving his post

Fort Bragg, North Carolina (CNN) US Army Sgt. Bowe Bergdahl could spend the rest of his life behind bars after he pleaded guilty Monday to desertion and misbehavior before the enemy.

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

"I left my observation post on my own," Bergdahl told a judge Monday. "I understand leaving was against the law."

JUST WATCHED Bergdahl wins release of classified docs (2016) Replay More Videos ... MUST WATCH Bergdahl wins release of classified docs (2016) 01:27

The 31-year-old said he deserted from his outpost to try to reach the base from where he was dispatched. Bergdahl told the judge he wanted to report "a critical problem in my chain of command," but did not specify what that problem was.