Image copyright AP Image caption Sgt Bergdahl (c), seen here at a pre-trial hearing, could face life in jail

US soldier Bowe Bergdahl, who left his unit in Afghanistan and was held by the Taliban for five years, has asked President Barack Obama to pardon him.

He is accused of putting his fellow soldiers in danger and faces a court-martial on charges including desertion.

If convicted in April, Sgt Bergdahl could face life in prison.

He was freed in May 2014 in a swap with five Taliban prisoners held at the US prison in Guantanamo. President-elect Donald Trump considers him a traitor.

Mr Trump said on the campaign trail that Sgt Berdahl should have been executed.

Sgt Bergdahl's lawyer Eugene Fidell called in December 2015 for Mr Trump to "cease his prejudicial months-long campaign of defamation against our client".

What do we know about Bergdahl's disappearance?

Profile: Sgt Bowe Bergdahl

The prisoner swap, initially hailed by Mr Obama, was criticised by others, including Republicans, for contravening policy against negotiating with terrorists.

For his part, Sgt Bergdahl, 30, has sought to justify his actions by saying he left his unit without authorisation in 2009 to highlight poor leadership.

The exact circumstances of his disappearance have yet to be clarified, but significant effort was put into trying to find him amid claims the search itself led to US military casualties.

The president has the power to grant what are called pre-emptive pardons even before conviction.

Gerald Ford pardoned his predecessor Richard Nixon in 1974, and President George HW Bush pardoned former Defense Secretary Casper Weinberger in 1992 after he was charged in connection with the Iran-Contra affair.