RALEIGH, North Carolina — Military prosecutors have reached into a section of military law seldom used since World War II in the politically fraught case against U.S. Army Sgt. Bowe Bergdahl, the soldier held prisoner for years by the Taliban after leaving his post in Afghanistan.

Observers wondered for months if Bergdahl would be charged with desertion after the deal brokered by the U.S. to bring him home. He was -- as well as misbehavior before the enemy, a much rarer offense that carries a stiffer potential penalty in this case.

Bergdahl could face a life sentence if convicted of the charge, which accuses him of endangering fellow soldiers when he "left without authority; and wrongfully caused search and recovery operations."

Observers say the misbehavior charge allows authorities to allege that Bergdahl not only left his unit with one less soldier, but that his deliberate action put soldiers who searched for him in harm's way. The Pentagon has said there is no evidence anyone died searching for Bergdahl.

"You're able to say that what he did had a particular impact or put particular people at risk. It is less generic than just quitting," said Lawrence Morris, a retired Army colonel who served as the branch's top prosecutor and top public defender.

The Obama administration has been criticized both for agreeing to release five Taliban operatives from the Guantanamo Bay prison and for heralding Bergdahl's return to the U.S. with an announcement in the White House Rose Garden. The administration stood by the way it secured his release even after the charges were announced.

The military has scheduled an initial court appearance hearing for Bergdahl on Sept. 17 at Fort Sam Houston, Texas. Afterward the case could be referred to a court-martial and go to trial.

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. Misbehavior before the enemy cases were tried at least 494 times for soldiers in Europe between 1942 and 1945, according to a Military Law Review article.

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

The misbehavior charge is included in Article 99 of the military justice code, which is best known for its use to prosecute cases of cowardice. However, Article 99 encompasses nine different offenses including several not necessarily motivated by cowardice, such as causing a false alarm or endangering one's unit — the charge Bergdahl faces.

Recent prosecutions under the misbehavior charge include a Marine lance corporal who pleaded guilty after refusing to provide security for a convoy leaving base in Iraq in 2004. A soldier in Iraq was charged with cowardice in 2003 under Article 99 after he saw a mangled body and sought counseling, but the charges were later dropped.

The specification that Bergdahl faces appears in the 1971 case of an Army captain accused of endangering a base in Vietnam by disobeying an order to establish an ambush position. The captain was found guilty of other charges including dereliction of duty.

Another case cited in a 1955 military law journal says an Army corporal was convicted under Article 99 of endangering his unit in Korea by getting drunk on duty. The article says he "became so drunk that it took the tank company commander thirty minutes to arouse him."

Bergdahl's attorney, Eugene Fidell, has argued his client is being charged twice for the same action, saying in a previous television interview that "it's unfortunate that someone got creative in drafting the charge sheet and figured out two ways to charge the same thing."

The scholars say that's a valid issue for Fidell to bring up in court, but it might not sway military authorities.

"The question is: Is it a piling on?" said Jeffrey K. Walker, a St. John's University law professor, retired Air Force officer and former military lawyer. "It does almost look like you're trying to get two bites at the same apple."