FORT BRAGG, N.C. (Reuters) - U.S. Army Sergeant Bowe Bergdahl pleaded guilty on Monday to deserting his duties in Afghanistan in June 2009 and endangering the lives of fellow troops, a step toward resolving the politically charged case that could send him to prison for life.

The 31-year-old Idaho native told a judge in Fort Bragg, North Carolina, that he walked off his combat outpost in Paktika province and headed to a nearby base to report “critical problems” in his chain of command.

But he got lost after 20 minutes, was captured by the Taliban several hours later and spent the next five years suffering torture, abuse and neglect in captivity.

The dangerous search for him that ensued - and the Taliban prisoner swap that won his release in 2014 - drew wide derision from soldiers and Republicans. During last year’s presidential campaign, Republican Donald Trump called Bergdahl “a no-good traitor.”

In court on Monday, Bergdahl admitted wrongdoing but said he never intended to put anyone at risk.

“I didn’t think there’d be any reason to pull off a crucial mission to look for one guy,” he said, adding that his actions were “very inexcusable.”

Bergdahl pleaded guilty to desertion and misbehavior before the enemy, with the latter offense carrying a possible life sentence.

Slideshow ( 4 images )

His decision to enter a “naked plea” - meaning he had not reached an agreement about the sentencing terms with prosecutors - came as a surprise to some military law experts.

The sentencing proceedings will begin on Oct. 23. Experts said the defense was betting on getting a better deal from Army Judge Colonel Jeffery Nance than it would have from a jury panel of officers.

Two law professors said they expect Bergdahl will receive a dishonorable discharge at a minimum.

“I think Colonel Nance will realize that the men who put their lives on the line looking for him are entitled to see a level of punishment that is appropriate for his misconduct,” said Geoffrey Corn, a professor at South Texas College of Law Houston and retired Army lieutenant colonel.

Army prosecutors will present evidence at sentencing of soldiers who were injured in the search for Bergdahl.

The judge can consider Bergdahl’s time in captivity, but Jeffrey Addicott, a retired lieutenant colonel in the Army, doubts it will help the soldier much.

Slideshow ( 4 images )

“He knew what the Taliban was, and he inflicted that on himself,” said Addicott, now a law professor at St. Mary’s University in San Antonio, Texas.

Bergdahl, who remains on active duty in a clerical job at a base in San Antonio, on Monday said he had tried to escape his captors up to 15 times.

The first attempt came on the day he was caught, Bergdahl said. Blindfolded, with a blanket over his head and his hands chained behind his back, he decided to run from the village where he had been taken.

But he quickly was tackled, he said, and taken to another location.