US Army soldier Bowe Bergdahl will be spared prison time after deserting his Afghan outpost in 2009, a judge has ruled.
Under the sentence in his court martial, the 31-year-old sergeant will be dishonourably discharged, reduced to private in rank and lose pay.
Prosecutors had argued Bergdahl should spend 14 years behind bars for endangering US troops in Afghanistan.
He spent five years in Taliban captivity after abandoning his post.
On Friday, the judge said the Idaho native must forfeit pay equal to $1,000 (£765) per month for 10 months.
Bergdahl had been facing up to life in prison after he pleaded guilty last month to desertion and misbehaviour before the enemy.
His lawyer Eugene Fidell told reporters outside court it had been “a terrible ordeal” for his client.
“He’s certainly glad this is over,” Mr Fidell added.
Major Justin Oshana, for the prosecution, told the sentencing hearing that other troops were injured in the hunt for Bergdahl.
But Captain Nina Banks, for the defence, said that when he deserted Bergdahl had not yet been diagnosed with schizotypal personality disorder, which includes grandiose thinking.
The soldier said he had walked away from his outpost in Paktika province to report problems in his unit.
On Monday, Bergdahl took the stand to apologise to the troops who were wounded in the search for him.
“I made a horrible mistake,” he said in the courtroom at Fort Bragg, North Carolina. “Saying I’m sorry is not enough.”
Master Sergeant Mark Allen was shot in the head during a July 2009 mission to find Bergdahl.
His wife, Shannon Allen, was a prosecution witness this week, describing the impact of her husband’s debilitating brain injury.
“Instead of being his wife, I’m his caregiver,” she said.
“Which doesn’t mean I love him any less, but it’s a very different dynamic.
“We can’t even hold hands anymore without me prying open his hand and putting mine in.”
Bergdahl testified that his Taliban captors had locked him in a cage after he briefly escaped.
He said he received little food, water or sleep and was forced to watch beheading videos.
Bergdahl was freed in a politically contentious 2014 Taliban prisoner swap brokered by the Democratic administration of former President Barack Obama.