Bowe Bergdahl, the US soldier held as a Taliban captive in Afghanistan for five years, has pleaded guilty to desertion and misbehaviour before the enemy.
The 31-year-old Army sergeant entered his plea on Monday before a military judge at Fort Bragg, North Carolina.
The Idaho native’s lawyers have argued he cannot get a fair trial following criticism from Donald Trump during last year’s presidential campaign.
Mr Trump had called him “a no-good traitor who should have been executed”.
“We may as well go back to kangaroo courts and lynch mobs,” Sgt Bergdahl said in a 2016 interview that was obtained by ABC News and broadcast on Monday.
In the remarks to British filmmaker Sean Langan, who was himself held captive by the same Taliban group in 2008, Sgt Bergdahl denied he had left his post in order to meet Taliban militants.
“You know, it’s just insulting frankly,” he said. “It’s very insulting, the idea that they would think I did that.”
Sgt Bergdahl is scheduled to face a pre-sentencing hearing starting on 23 October.
The maximum penalty for misbehaviour before the enemy is life in prison, and the maximum sentence for desertion is five years.
In an audio interview last year for the Serial podcast, Sgt Bergdahl said he walked off his combat post to prove to senior officers his commanders were “unfit” for service.
The decision to exchange five Taliban captives from Guantanamo Bay in order to secure Sgt Bergdahl’s release was heavily criticised by Republican lawmakers as contrary to US policy of not negotiating with terrorists.
Several former platoon mates have alleged US soldiers were killed or wounded during the frantic 45-day search for Sgt Bergdahl.
During Mr Trump’s presidential campaign, he called Bergdahl “garbage” and suggested he should be summarily executed.
“You know in the old days – bing, bong,” Mr Trump said at a campaign rally as he imitated firing a gun. “When we were strong.”