WASHINGTON — Army Sgt. Bowe Bergdahl, who was held captive by the Taliban for five years and freed in exchange for five detainees in Guantanamo Bay, will face charges of desertion and misbehavior before the enemy in a general court-martial, the Army announced on Monday.

If convicted, Bergdahl could get life in prison on the misbehavior charge and up to five years for desertion. He also could be dishonorably discharged, reduced in rank and made to forfeit all pay.

Bergdahl, 29, of Hailey, Idaho, walked off his post in eastern Afghanistan’s Paktika province on June 30, 2009. He was released in the prisoner swap in late May 2014 that touched off a firestorm of criticism, with some in Congress accusing President Barack Obama of jeopardizing the safety of a nation for a deserter.

Story‘Serial’ returns with season 2

A date for an arraignment hearing at Fort Bragg, North Carolina, will be announced later.

Bergdahl’s attorney, Eugene Fidell, said the convening authority — a high-ranking officer charged with deciding whether evidence warrants a court-martial — did not follow the advice of a preliminary hearing officer.

Lt. Col. Mark Visger had recommended that Bergdahl’s case be referred to a special court martial, which is a misdemeanor-level forum. That limits the maximum punishment to reduction in rank, a bad-conduct discharge and a term of up to a year in prison.

advertisement | advertise on newsday

The U.S. Army Forces Command charged Bergdahl on March 25 with “desertion with intent to shirk important or hazardous duty” and “misbehavior before the enemy by endangering the safety of a command, unit or place.”

Misbehavior before the enemy was used hundreds of times during World War II, but scholars say its use appears to have dwindled in conflicts since then. Legal databases and media accounts turn up only a few misbehavior cases since 2001 when fighting began in Afghanistan, followed by Iraq less than two years later. By contrast, statistics show the U.S. Army prosecuted about 1,900 desertion cases between 2001 and the end of 2014.

Fidell has argued his client is being charged twice for the same action, saying in a previous television interview that “it’s unfortunate that someone got creative in drafting the charge sheet and figured out two ways to charge the same thing.”

@Newsday

Separately, Fidell, a military justice expert who is also a visiting lecturer at Yale Law School, complained about political figures who have made derogatory statements about Bergdahl.

Fidell asked that Republican presidential candidate Donald Trump “cease his prejudicial months-long campaign of defamation against our client. In October, Trump called Bergdahl a “traitor, a no-good traitor, who should have been executed.”

Bergdahl’s disappearance and the possibility that he might face light punishment had angered many in the military, given that his fellow soldiers took considerable risks in searching for him. The Pentagon has said no one died in searching for Bergdahl.

Fidell also asked the House and Senate Armed Services committees to avoid further statements “that prejudice our client’s right to a fair trial.” The House committee last week issued a 98-page report criticizing the Obama administration’s decision to swap the five former Taliban leaders for Bergdahl.

Fidell pointed to the fifth page of the report that said the committee would remain abreast of the disciplinary process and ensure that “Sgt. Bergdahl’s behavior is adjudicated as required.” Fidell said he read that as a call to “hammer” Bergdahl for his actions.

advertisement | advertise on newsday

Bergdahl hasn’t spoken publicly about his decision to walk away from his post or his subsequent five-year imprisonment by the Taliban and the prisoner swap in May 2014 that secured his return to the United States. But during the past several months, he spoke extensively with screenwriter Mark Boal, who shared about 25 hours of the recorded interviews with Sarah Koenig for her popular podcast, “Serial.”

Bergdahl says in the interviews that he walked off his base to cause a crisis that would catch the attention of military brass. He wanted to warn them about what he believed were serious problems with leadership in his unit. And he wanted to prove himself as a real-life action hero, like someone out of a movie.

“As a private first-class, nobody is going to listen to me,” Bergdahl says in the first episode of the podcast, released Thursday. “No one is going to take me serious that an investigation needs to be put underway.”

Bergdahl acknowledges his motives weren’t entirely idealistic.

“I was trying to prove to myself, I was trying to prove to the world, to anybody who used to know me ... I was capable of being what I appeared to be,” Bergdahl says. “I had this fantastic idea that I was going to prove to the world I was the real thing.”

advertisement | advertise on newsday

He also discusses the psychological torment of being held captive for years.

“How do I explain to a person that just standing in an empty dark room hurts?” Bergdahl recounts. “A person asked me, ‘Why does it hurt? Does your body hurt?’ Yes, your body hurts, but it’s more than that. It’s mental, like, almost confused. ... I would wake up not even remembering what I was.”