A US soldier who deserted his post in Afghanistan has been spared jail - a decision Donald Trump has described as "a disgrace".

Sergeant Bowe Bergdahl was captured and held hostage by the Taliban for five years after walking off his post in 2009.

The 31-year-old pleaded guilty to desertion and misbehaviour before the enemy, but on Friday a military judge ruled that he should serve no prison time.

During his presidential campaign, Mr Trump repeatedly called Bergdahl a "rotten traitor" and said he "should have been executed".

Reacting to the serviceman's sentence, the President tweeted: "The decision on Sergeant Bergdahl is a complete and total disgrace to our country and to our military."


Bowe Bergdahl release video

Bergdahl claimed he abandoned his position at Observation Post Mest Malak, Paktika Province, to spark a panic and draw attention to problems with his unit.

But his plan to walk to another US base failed within hours as he was located and abducted by Taliban fighters.

Bergdahl said he was tortured in captivity and spent years either locked in a cage or chained on all fours.

A Navy Seal and an Army National Guard were seriously wounded in attempts to rescue him from his captors - sparking debate in the US over whether efforts to secure his release should be stopped.

He was eventually freed in 2014 when former president Barack Obama approved a swap for five Taliban prisoners at Guantanamo Bay.

During his military trial, Bergdahl apologised to soldiers injured during rescue efforts.

Image: Donald Trump repeatedly called Bergdahl a 'rotten traitor'

He said: "I would like everyone who searched for me to know it was never my intention for anyone to be hurt, and I never expected that to happen.

"My words alone can't take away their pain."

A psychiatrist told the hearing that Bergdahl's decision to leave his post was influenced by post-traumatic stress disorder and a schizophrenia-like condition called schizotypal personality disorder.

Dr Charles Morgan said the latter condition made it difficult for Bergdahl to understand the consequences of his actions.

The serviceman was given a dishonourable discharge, had his rank reduced to private and was ordered to forfeit $10,000 (£7,650) in pay over 10 months.

Prosecutors had pushed for Bergdahl to be jailed for 14 years.

Image: Bergdahl apologised to soldiers injured in attempts to rescue him

Following the hearing, defence lawyer Eugene Fidell criticised Mr Trump for making "really extraordinary reprehensible comments targeted directly at our client".

He added that the President helped to create "one of the most preposterous states of affairs" in American legal history.

Meanwhile, a soldier who was wounded searching for Bergdahl has described the sentence as "completely unacceptable".

Jonathan Morita, from California, underwent three operations and lost the use of two fingers on his right hand after he was hit by a rocket-propelled grenade, which didn't explode.

"I've had better days," Mr Morita said. "He'll pay the fine like people get fined for illegal fishing.

"It should have maybe not been the life sentence, but it should have been something."