FORT BRAGG, N.C. (AP) — U.S. Army Sgt. Bowe Bergdahl, who disappeared in Afghanistan in 2009 and was held by the Taliban for five years, appeared Tuesday before a military judge on charges of desertion and misbehavior before the enemy.

Bergdahl was arraigned during a short hearing and deferred entering a plea and did not decide whether he wants to face a court-martial with a jury or one with just a judge. He said little beyond answering “yes” and “no” to questions about whether he understood his rights and the court proceedings. He wore an Army dress uniform with a dark blue jacket and pants and had closely cropped hair.

He appeared demure, sitting mostly still in his chair then walking deliberately with his head down as he left the courtroom. He talked quietly with his military attorney before and after the hearing.

If convicted at a general court-martial, Bergdahl could get life in prison on the misbehavior charge and up to five years for desertion.

The judge in the case, Col. Christopher Fredrikson, scheduled a Jan. 12 pretrial hearing to discuss motions.

Bergdahl, 29, of Hailey, Idaho, walked off his post in eastern Afghanistan’s Paktika province on June 30, 2009. He was released in late May 2014 as part of a prisoner swap, in exchange for five detainees in Guantanamo Bay. The move touched off a firestorm of criticism, with some in Congress accusing President Barack Obama of jeopardizing the safety of the country with the exchange.

Bergdahl attorney Eugene Fidell has said the Army did not follow the advice of a preliminary hearing officer in choosing to pursue a general court-martial over a special court-martial, which is a misdemeanor-level forum.

Bergdahl’s disappearance and the possibility that he might face light punishment had angered many in the military, who say his fellow soldiers took considerable risks to search for him. Earlier this month, the Army announced he would face the more serious general court-martial.

The charge of 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. In contrast, statistics show the U.S. Army prosecuted about 1,900 desertion cases between 2001 and the end of 2014.

Copyright 2015 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.