Updated

Army Sgt. Bowe Bergdahl, who walked off his combat outpost in Afghanistan and spent five years in captivity, will be court-martialed under a new commander-in-chief.

A military judge decided Tuesday to delay Bergdahl's trial from August until February to provide time for resolving disputes over the defense team's access to classified documents.

Bergdahl, now 30, sat attentively in his dress blue formal uniform, his infantry cord looped under the epaulet on his right shoulder, during the brief hearing. The soldier from Hailey, Idaho, faces charges of desertion and misbehavior before the enemy. The latter charge is relatively rare and carries the potential of life in prison.

He was exchanged in a controversial swap for five high-ranking Taliban commanders from Guantanamo Bay in 2014.

A February start would mean the court-martial could make headlines only weeks after the new commander-in-chief is sworn in as president.

The judge, Col. Jeffrey Nance, also ruled that media organizations could hire a stenographer to capture courtroom discussions during the trial, and he gave Army prosecutors one week to provide reporters covering the case with online access to court documents.

The judge postponed deciding a dispute that could influence how much punishment Bergdahl could face if convicted.

The Army's primary investigating officer last year recommended against Bergdahl facing jail time, saying there is no evidence that any service members were killed or wounded searching for him in Afghanistan. A preliminary hearing officer recommended against a bad-conduct discharge.

But those recommendations were scrapped in December by the general overseeing the case. Gen. Robert Abrams, who leads the Army Forces Command at Fort Bragg, instead sided with an Army lawyer's recommendation for a general court-martial.

Bergdahl's defense lawyers contend that the Army lawyer's advice to Abrams was so incomplete that it misled the four-star general. Nance did not explain why he opted against taking up the issue Tuesday.

Bergdahl was quickly captured after walking off his combat post in Afghanistan in 2009, and held as a prisoner by the Taliban and its allies until President Barack Obama exchanged five Guantanamo Bay detainees for his safe return, saying the U.S. "does not ever leave our men and women in uniform behind."

Obama's decision was harshly criticized. Some members of Congress said it jeopardized national security. Trump has targeted Bergdahl for scorn dozens of times on the campaign trail, saying among other things that he should have been thrown from a plane.

The defense's complaints about Trump have no bearing on the case right now, according to Rachel VanLandingham, a former Air Force lawyer who teaches at Southwestern Law School in Los Angeles. But if he is elected in November and keeps up his harsh comments, the defense could more effectively argue that a President Trump is unfairly pressuring Army brass for a conviction, she said.

Meanwhile, law enforcement officials have been notified that threats against Bergdahl continue.

"Given the many incendiary comments that have been broadcast and otherwise disseminated about Sgt. Bergdahl, his immediate commander at Fort Sam Houston has taken measures to ensure his physical safety when leaving the installation," his attorneys wrote in February.

A spokesman at the Texas post declined to describe these measures, citing security considerations. But as "a group of soldiers, battle buddies, we all look out for each other," Sgt. Maj. Matt Howard said.

Bergdahl can come and go the same as any other soldier from Fort Sam Houston, where he works a desk job in a headquarters unit, handling "a lot of administrative work that needs to be done. Paperwork, moving stuff from place to place, things like that," Howard said.

Fox News' Lucas Tomlinson and The Associated Press contributed to this report.