Updated

President Trump's criticism of Army Sgt. Bowe Bergdahl has become a factor in the soldier's sentencing as a military judge weighs the president's impact on public perception of military justice.

Army Col. Jeffery R. Nance, the judge deciding Bergdahl's punishment for walking off his post, heard defense arguments Monday that Trump recently reaffirmed his scathing criticism and is preventing a fair sentencing hearing.

While campaigning, Trump repeatedly called Bergdahl a "traitor" who deserved harsh punishment such as being shot. Nance previously ruled those comments were "disturbing" but didn't amount to unlawful command influence and noted the statements were made before Trump became commander in chief.

But last week Trump addressed his past comments when asked about them at a news conference. He replied that he couldn't say anything more about the case, "but I think people have heard my comments in the past." That, the defense said, shows he harbors the same views now that he commands the military.

Prosecutors argued Trump's comments didn't reaffirm his campaign-trail criticism and were narrowly focused on answering a reporter.

Nance said he was having a "hard time" with prosecutors' interpretation, noting public confidence in military courts was something he had to consider.

Nance said his interpretation was that Trump was essentially saying: "I shouldn't comment on that, but I think everyone knows what I think on Bowe Bergdahl."

Bergdahl faces a maximum sentence of life in prison after pleading guilty last week to desertion and misbehavior before the enemy. Nance allowed the attorneys to question him about whether he was swayed by Trump's comments, and responded that he would be fair.

"I don't have any doubt whatsoever that I can be fair and impartial in the sentencing in this matter," Nance said.

Former Army lawyer Eric Carpenter said the judge has to worry not only about whether Trump has directly influenced the case, but also what the public thinks under a military justice concept called apparent unlawful command influence. Nance's remarks Monday should resolve the question of whether Trump directly swayed the court, but the judge could still make concessions to the defense to address these concerns, Carpenter said.

"It gives you a clue that he's concerned about public appearance, and he can grant pretty significant remedies just to preserve the public's faith in the system," said Carpenter, who teaches law at Florida International University.

Carpenter doubts the judge would dismiss the case outright, but said Nance could limit Bergdahl's punishment because of Trump.

The White House issued a statement Friday that any military justice case must be "resolved on its own facts." White House representatives didn't respond to an email seeking comment Monday.

Bergahl's sentencing, set to begin Monday, has been delayed until Wednesday because one of the defense attorneys wasn't available until then, the judge said.

Bergdahl, 31, pleaded guilty last week. Prosecutors made no deal to cap his punishment, so the judge has wide leeway to decide his sentence. Several more days of testimony are expected.

Nance is expected to weigh factors including Bergdahl's willingness to admit guilt, his five years of captivity by Taliban allies, and serious wounds suffered by soldiers and a Navy SEAL who searched for him.

Bergdahl, from Hailey, Idaho, was captured soon after walking off his remote post in 2009. He has said he was caged, kept in darkness and beaten, and tried to escape more than a dozen times before President Obama brought Bergdahl home in 2014 in a swap for five Taliban prisoners at Guantanamo Bay.

The Associated Press contributed to this report