FORT BRAGG, N.C. - U.S. Army Sergeant Bowe Bergdahl, who spent five years as a Taliban prisoner after walking away from his combat outpost in Afghanistan in 2009, did not enter a plea on Tuesday at his arraignment on charges spurred by his disappearance.

Bergdahl, 29, was ordered last week to face a court-martial after being charged earlier this year with desertion and endangering U.S. troops. The latter offense carries a life sentence if he is convicted.

A military judge on Tuesday granted Bergdahl permission to defer his plea and a decision on whether a military jury or a judge alone will hear his case.

"The accused wishes to defer for reflection," said Lieutenant Colonel Franklin Rosenblatt, Bergdahl's lawyer, at a brief hearing at Fort Bragg, N.C.

Bergdahl, dressed in uniform, said little, offering "Yes" or "No" answers to the judge's questions or allowing his lawyer to speak on his behalf.

The soldier's case has been controversial. Some fellow troops resented the military resources devoted to searching for Bergdahl, and Republicans criticized the Obama administration for the deal that freed him in a prisoner swap with the Taliban in 2014.

Bergdahl is now stationed at Fort Sam Houston in San Antonio, Texas, near the hospital where he has been treated since his release from captivity.

He disappeared on June 30, 2009, from Combat Outpost Mest-Malak in Paktika Province, Afghanistan, and was captured by Taliban forces who subjected him to torture and neglect.

He left his post to draw attention to "leadership failure" in his unit, Bergdahl said on the popular podcast Serial.

In ordering the court-martial, Army General Robert Abrams did not follow the recommendation of a preliminary hearing officer who, according to Bergdahl's lawyer, called for him to face a proceeding that could impose a potential maximum penalty of a year in confinement.

Geoffrey Corn, a retired Army lieutenant colonel who teaches at the South Texas College of Law, said he would not be surprised if a panel or judge decides Bergdahl should not go to prison for his alleged military crimes.

"These are people who are able to sort out the difference between extremely aggravated offenses and offenses committed by people who just make really stupid decisions," Corn said.