A military judge has found that Bowe Bergdahl should serve no prison time for endangering his comrades by walking off his post in Afghanistan.
The judge also gave the former US Army sergeant a dishonourable discharge, reduced his rank to private and said he must forfeit pay equal to $1,000 (€861) per month for 10 months.
Bergdahl appeared tense, grimaced and clenched his jaw. His lawyers put their arms around him and one patted him on the back.
Bergdahl pleaded guilty to desertion and misbehaviour before the enemy and had faced up to life in prison. The judge had wide leeway because Bergdahl made no deal with prosecutors to limit his sentence.
Prosecutors had sought stiff punishment because of wounds to service members who searched for Bergdahl after he disappeared in 2009. He was held captive by Taliban allies for five years.
The defence sought to counter that evidence with testimony about Bergdahl's suffering during five years as a captive, his contributions to military intelligence and survival instruction and his mental health problems.
The sentence caps a politically divisive episode that centred on one soldier's decision that affected many other lives.
Barack Obama was criticised for trading Taliban prisoners to bring him back. As a presidential candidate, Donald Trump had called for Bergdahl to face stiff punishment.
A punitive discharge deprives Bergdahl of most or all of his veterans' benefits.
In closing arguments, defence lawyers argued he had suffered enough confinement during five years of brutal captivity. They asked the judge to give their client a dishonourable discharge and no prison time. Their argument for leniency also cited harsh campaign-trail criticism by Mr Trump.
Captain Nina Banks, a defence lawyer, said it would not be justice to rescue Bergdahl from the Taliban "only to place him in a cell" now.
Bergdahl told the sentencing hearing he was sorry for the wounds suffered by searchers. He also described brutal beatings by his captors, illness brought on by squalid conditions and maddening periods of isolation.
A psychiatrist said his decision to leave his post was influenced by a schizophrenia-like condition called schizotypal personality disorder that made it hard to understand consequences of his actions, as well as post-traumatic stress disorder brought on partly by a difficult childhood.
Prosecutors had asked for a sentence of 14 years in prison, citing serious wounds to service members who looked for Bergdahl.
"Sgt Bergdahl does not have a monopoly on suffering as a result of his choices," said Major Justin Oshana, a prosecutor.
Bergdahl pleaded guilty on October 16.
The 31-year-old soldier, from Hailey, Idaho, was brought home by Mr Obama in 2014 in a swap for five Taliban prisoners at Guantanamo Bay. Mr Obama said at the time the US does not leave its service members on the battlefield.
Republicans roundly criticised him, and Mr Trump went further while campaigning for president, repeatedly calling Bergdahl a traitor who deserved serious punishment.