U.S. Army Sergeant Bowe Bergdahl is pictured in this undated handout photo provided by the U.S. Army. U.S. Army/Handout via Reuters

(Reuters) - U.S. Army Sergeant Bowe Bergdahl, charged with desertion and endangerment of U.S. troops for leaving his combat post in Afghanistan in 2009, has chosen to have a judge hear the case instead of a military jury, according to a court filing.

Bergdahl and his attorneys made their intentions known in a court filing dated on Wednesday but first reported on Monday. An accused in a court-martial case has a right to be tried by a judge alone.

Bergdahl, who spent five years as a prisoner of the Taliban, faces a maximum of life in prison if convicted of endangerment of U.S. troops at his court martial.

An attorney for Bergdahl declined to comment on the reason the sergeant decided against having a panel of military officers hear the case.

Bergdahl was freed in a prisoner swap in May 2014 involving the release of five Taliban leaders held by the United States, in a deal that drew heavy criticism from Republicans.

U.S. military prosecutors charge that Bergdahl sneaked off his post, leading to a 45-day search that endangered other soldiers’ lives.

The head of the Army team that investigated Bergdahl has said he does not believe the sergeant should face jail time.

The trial is expected to begin in October.