"I left my observation post on my own," Bergdahl told a court martial in Fort Bragg, North Carolina, according to CNN. "I understand leaving was against the law."
The decision to plead guilty put an end to more than two years of legal jousting over a case that inflamed US political divisions over the Afghan war.
Earlier this year Bergdahl's lawyers sought to have the case against him thrown out after President Donald Trump labelled him a "dirty rotten traitor," ostensibly prejudicing the case.
But the court ruled that Trump's words, even if he was the incoming commander in chief, did not have any weight in the courtroom.
More From This Section
Asked about Bergdahl's guilty plea yesterday, Trump said: "I'm not going to comment on him, but I think people have heard my comments in the past."
Bergdahl, 31, disappeared from Combat Outpost Mest-Malak in rugged Paktika Province, eastern Afghanistan, on June 20, 2009.
After departing the base, leaving behind his firearm, the young soldier was quickly captured by militants and held prisoner by the feared Haqqani faction, a Taliban-linked, Pakistan-based outfit blamed for many deadly attacks on US soldiers.
A search and rescue mission was launched and some of Bergdahl's former comrades have accused him of putting their lives in danger by his actions. He was eventually freed in a May 2014 deal after the United States released five Afghan detainees from Guantanamo Bay.
A private first class at the time of his disappearance, he was automatically promoted twice in captivity, first to the rank of specialist and then sergeant.
The case divided the American public, with many regarding him as a classic deserter to the enemy but others viewing him as representative of the difficulties US service members have under the conditions of the country's long war in Afghanistan.
And president Barack Obama's decision to trade five Taliban detainees for Berghdahl sparked outrage from critics, including other serving and former soldiers, who accused the president of trading "terrorists" for a "traitor."
In a serial podcast on his case two years ago broadcast by National Public Radio, Bergdahl said that he "left his post to try to stir controversy in order to get the attention of top military officials so he could explain problems he saw in the Army."
Bergdahl pleaded guilty to one count of desertion and a second of misbehavior before the enemy, also referred to as endangering troops. The first charge carries a maximum sentence of five years in prison while the second could mean up to life in prison.
The court will now turn to hearing arguments over his sentence. According to reports, soldiers who were injured in the search to find him could testify.