One of the U.S. military’s highest-profile court cases in decades will open Thursday with prosecutors dissecting Army Sgt. Robert Bowdrie “Bowe” Bergdahl’s decision to walk away from his combat outpost in Afghanistan in 2009, potentially paving the way for a trial and prison time for a soldier who was held captive by insurgents for more than five years.

Bergdahl, 29, faces charges of desertion and misbehavior before the enemy. He was recovered in Afghanistan by the United States in May 2014 in a controversial prisoner swap approved by the Obama administration in which five Taliban officials detained at the military prison at Guantanamo Bay, Cuba, were transferred to supervised release in Qatar. If convicted, Bergdahl faces up to life in prison.

The proceedings at Joint Base San Antonio – Fort Sam Houston in Texas, known as an Article 32 hearing, are expected to last at least two days and lay out new evidence against the soldier. A military lawyer overseeing the hearing will then make recommendations to the senior officer in charge of the case, Gen. Robert B. Abrams, about whether to proceed to a court-martial trial in coming months.

Bergdahl’s defense team will be given time to cross-examine witnesses and challenge the government’s case.

The case remains deeply emotional for many who have served in the military and consider it a personal affront for someone to walk away from comrades in a combat zone. His critics argue that Bergdahl put lives in danger from the moment he left his post on June 30, 2009, and needs to be held accountable.

“If Bergdahl gets off scot-free, it would be an atrocity for anyone who has served with him, and anyone who has served honorably over the last 200 years,” said former Army Spec. Joshua Cornelison, 26, who was deployed with Bergdahl’s platoon as a medic. “Whatever the maximum punishment is, that’s what he should get.”

Bergdahl vanished in the middle of the night from an austere, 150-yard-long base in southeastern Afghanistan that was known as Observation Post Mest and was home to about 30 soldiers. His disappearance triggered “90 days of absolute craziness,” with soldiers across Paktika province and beyond launching a series of raids, helicopter assaults and reconnaissance operations in a desperate attempt to recover him, Cornelison said.

Bergdahl’s lawyer, Eugene Fidell, has raised questions about whether his client can get a fair trial anywhere, in light of the intense media coverage of his case and sustained interest in it on Capitol Hill. Soldiers were assigned to protect Bergdahl from his fellow soldiers after he was recovered, Fidell said in a March letter to Gen. Mark A. Milley, now the Army’s top officer.

Fidell wrote that Bergdahl’s intent “was to bring what he thought were disturbing circumstances” about his unit to the attention of senior commanders. In a brief interview with The Washington Post, the lawyer expressed wariness about sharing too many details ahead of the hearing.

“Despite the torrent of abuse that Sergeant Bergdahl has taken in the right-wing media, we’re not going to try this case in the press,” Fidell said.

The case remains politically sensitive for the Obama administration. The nonpartisan Government Accountability Office found that the swap of Taliban officials for Bergdahl violated federal law because the White House did not provide Congress with 30 days notice before the exchange. Administration officials and the Pentagon have defended the decision, saying the United States had a small window of time to act in order to secure Bergdahl and that the decision was reviewed by the Justice Department.

The White House’s handling of the case after Bergdahl’s release also has been questioned. Flanked by Bergdahl’s parents, Obama said in a Rose Garden announcement last year that Bergdahl was not forgotten by his country. National security adviser Susan E. Rice said the soldier had served with “honor and distinction,” drawing protests from critics. She defended the remarks by saying she was referring to his decision to join the military in the first place.

Bergdahl is accused of deliberately slipping away from his post in order to “shirk important service and avoid hazardous duty,” prompting the desertion charge. The misbehavior before the enemy charge, which is rarely prosecuted, stems from allegations that he endangered fellow soldiers at his small outpost and beyond, prompting search and rescue operations that put the lives of fellow service members in danger.

Bergdahl allegedly left his post with little more than a few provisions and his knife, leaving behind his rifle, helmet and other essentials. It was initially reported that he was captured after lagging behind on a foot patrol, angering fellow soldiers in his unit, said Nathan B. Bethea, a former Army captain who was in Bergdahl’s battalion. Soldiers were told not to talk about what happened and came to distrust how the government was handling the case, he said.

“You get a broad spectrum of opinion, but I think the one thing you see over and over is that they want this case to go forward without any further delays,” Bethea said of his fellow soldiers. “They want to see it go forward without any intentional setbacks, either by the defense or people in the Army who just want to see this go away.”

The case will most likely head to trial because of the amount of evidence against Bergdahl and the military’s desire to not look like it is going easy on him, said Geoffrey Corn, a former Army lawyer and a professor at South Texas College of Law in Houston. The arguments in court will likely focus heavily on what Bergdahl was thinking when he disappeared, he said.

“I think the real fight will be over what was his state of mind when he left the base,” Corn said. Prosecutors, he said, must show Bergdahl “knew he was putting his unit in danger and knew he was abandoning his combat outpost without the willingness to defend himself.”

If the case progresses to a court-martial, Bergdahl’s lawyers will need to take great care in screening potential jury members to make sure they are impartial, considering the amount of attention the case has received, said Charles W. Gittins, a former military lawyer and career defense counsel. Abrams, the convening authority for the case, would select the service members on a panel that would decide Bergdahl’s fate and recommend a verdict and sentence.

“You want to get the member talking and get him to tell you everything he remembers about the case,” Gittins said. “The military tends to be a pretty homogeneous group. You don’t tend to get a lot of outliers.”

Gittins and Eric Montalvo, a former Marine Corps lawyer, said the case also could be complicated by the use of the misbehavior before the enemy charge, which rarely has been used in modern times. Desertion cases are frequently prosecuted by the military, but the other charge Bergdahl faces has rarely come before modern military judges or appellate courts, Montalvo said.

“To charge that and try to prove that up, I don’t know why they would do that,” Montalvo said. “It just doesn’t make sense. It gives you Mount Everest to climb for no good reason.”

Corn disagreed, saying that if the Army can prove Bergdahl deserted, it should not be difficult to also show that he put his fellow soldiers in a dangerous situation. Given the time he already has spent in captivity, however, it is hard to picture the military imprisoning him for years to come, he added.

If found guilty, “it’s inconceivable to me that he would get anything close to life in prison,” Corn said. “I would be surprised if he got even a couple years in jail.”