US Army Sergeant Bowe Bergdahl told a military judge on Monday that he was pleading guilty to desertion and misbehaviour before the enemy.

"I understand that leaving was against the law," Bergdahl said.

"At the time, I had no intention of causing search and recovery operations," Bergdahl added, saying that now he does understand that his decision to walk off his remote post in Afghanistan in 2009 prompted efforts to find him.

Bergdahl, 31, is charged with endangering his comrades by walking away from his post.

Despite his plea, the prosecution and defence have not agreed to a stipulation of facts in the case, according to one of his lawyers, Major Oren Gleich, which is an indication that they did not reach a deal to limit his punishment.

The misbehaviour charge carries a maximum penalty of life in prison, while the desertion charge is punishable by up to five years.

He appears to be hoping for leniency from the judge, Army Colonel Jeffery R. Nance, at Fort Bragg in North Carolina.

The guilty pleas bring the highly politicised saga closer to an end eight years after his disappearance in Afghanistan set off search missions by scores of his fellow service members.

President Barack Obama was criticised by Republicans for the 2014 Taliban prisoner swap that brought Bergdahl home, while President Donald Trump harshly criticised Bergdahl on the campaign trail.

The serious wounds to service members who searched for Bergdahl are still expected to play a role in his sentencing.

The guilty pleas allow him to avoid a trial, but he still faces a sentencing hearing that's expected to start on October 23.

Bergdahl's five years of captivity by the Taliban and its allies also will likely factor into what punishment he receives.

Bergdahl, who is from Hailey, Idaho, previously chose to have his case heard by a judge alone, rather than a jury.

Legal scholars have said that several pretrial rulings against the defence have given prosecutors leverage to pursue stiff punishment against Bergdahl.

Perhaps most significant was the judge's decision in June to allow evidence of serious wounds to service members who searched for Bergdahl at the sentencing phase.

The judge ruled that a Navy Seal and an Army National Guard sergeant would not have wound up in separate firefights that left them wounded if they had not been searching for Bergdahl.

The defence also was rebuffed in an effort to prove President Donald Trump had unfairly swayed the case with scathing criticism of Bergdahl, including suggestions of harsh punishment.

The judge wrote in a February ruling that Mr Trump's campaign-trail comments were "disturbing and disappointing" but did not constitute unlawful command influence by the soon-to-be commander in chief.