The Bowe Bergdahl case was briefly back in court this summer, as attorneys for the former soldier argued that President Donald Trump’s comments about a conviction and prison time amounted to undue command influence and interfered with his right to a fair trial.

The Army Court of Criminal Appeals convened a three-judge panel to hear the case, and in a 2-1 ruling affirmed Bergdahl’s guilty plea and previous sentence — a reduction in rank to private, a $10,000 fine and a dishonorable discharge.

Bergdahl’s attorney told Army Times that the legal team now plans to appeal to the civilian court with jurisdiction over the U.S. armed forces in Washington, D.C.

“Although there was some evidence of unlawful command influence adduced at trial and in the post-trial process, the government met its burden to demonstrate that an objective disinterested observer would not harbor a significant doubt as to the fairness of the proceedings,” the Army appeals court opinion reads.

In a dissenting opinion, Army Judge James Ewing wrote that undue command influence did play a part in sentencing, adding that he would have set aside the dishonorable discharge. That conclusion was largely based on the president’s past statements and a day-of-sentencing statement that labeled Bergdahl “a complete and total disgrace."

Ewing noted that there is “no perfect resolution” in Bergdahl’s case, as Trump’s influence cannot be circumnavigated by moving the case to a different convening authority because the president is the highest in the chain of command.

The best guidance was from earlier phases in the investigation and trial, Ewing wrote. That includes a preliminary hearing officer’s recommendation that Bergdahl be referred to a special court-martial not empowered to adjudge a discharge and an investigating officer’s recommendation for no jail time.

“Setting aside appellant’s dishonorable discharge would bring his current sentence into line with these two recommendations, and thus purge the taint of post-trial UCI that emanated from the President’s day-of-sentencing tweet," Ewing added.

× Fear of missing out? Sign up for the Army Times Daily News Roundup to receive the top Army stories every afternoon. Thanks for signing up. By giving us your email, you are opting in to the Army Times Daily News Roundup.

The dissenting opinion will likely help Bergdahl’s legal team as they move the case further along the appeals process.

“We plan to take this to the U.S. Court of Appeals for the Armed Forces as soon as possible,” Eugene Fidell, a Yale Law School lecturer and former Coast Guard judge advocate who represented Bergdahl, told Army Times on Wednesday.

Bergdahl was out of U.S. control for five years and was believed to have been held by the Haqqani network. (Voice Of Jihad Website via AP)

Bergdahl, then a sergeant, pleaded guilty in 2017 to desertion and misbehavior before the enemy after leaving his post in 2009 while deployed to Afghanistan’s Paktika province, with 4th Brigade Combat Team, 25th Infantry Division.

He was quickly captured by insurgents and held hostage until 2014, when the Obama administration negotiated his return in exchange for five Guantanamo Bay detainees.

Over the course of Bergdahl’s repatriation and subsequent trial, the president periodically weighed-in on the situation.

“In the old days when we were strong and wise, we [would] shoot a guy like that,” Trump said in 2015, during his campaign for president.

After taking office, Trump’s commentary on Bergdahl’s case decreased. But during an October 2017 press conference in the White House Rose Garden, the president remained committed to his past assessment of the situation.

“I think people have heard my comments in the past," he said at the time.

During his trial, Bergdahl’s legal team argued that Trump’s comments tainted the process. The judge, Army Col. Jeffrey Nance, declared them mitigating evidence, which can reduce punishment in sentencing.

During his five years in captivity, the Taliban subjected Bergdahl to torture that included long periods in darkness, beatings with a copper cable, being forced to wear chains, held in a cage and threatened with execution after trying to escape roughly a dozen times.

The five Guantanamo Bay detainees swapped for Sgt. Bowe Bergdahl are, from left, Mullah Norullah Noori, Mohammed Nabi Omari, Mohammed Fazl, Khairullah Khairkhwa and Abdul Haq Wasiq. (DoD)

“In the beginning of my captivity, after my first two escape attempts, for about three months I was chained to a bed spread-eagle and blindfolded,” Bergdahl wrote in a note made public by his lawyer during the trial process.

“Around my ankles where the chains were, I developed open wounds. ... During these months some of the things they did was beat the bottoms of my feet and parts of my body with a copper cable.”

Bergdahl has kept a low profile since returning from captivity, only rarely offering explanations for his actions in Afghanistan.

In 2016, documents released by Bergdahl’s attorneys explained that he left his post to draw attention to what he saw as bad decisions by officers above him. Those documents also showed that he was diagnosed with a psychiatric disorder.

Bergdahl told the general who investigated his case — Maj. Gen. Kenneth Dahl — that he hoped to leave his outpost and make it to a larger base in order to impress a high-ranking commander.

“So, the idea was to — it was— literally, it was a sacrificial — it was a self-sacrifice thing,” Bergdahl said, according to the transcript of a 2014 interview during the investigation.

An Army Sanity Board evaluation also determined that Bergdahl suffered from schizotypal personality disorder when he abandoned his post in 2009.