A military judge called Donald Trump’s scathing campaign-trail criticism of army Sgt Bowe Bergdahl “disturbing” on Monday and questioned whether it would make the public think the soldier could not get a fair trial for walking off his post in Afghanistan in 2009.

During a pre-trial hearing, defense attorneys played part of a video exhibit in which Trump repeatedly says at campaign appearances that Bergdahl is a “traitor” who should be harshly punished. Bergdahl’s lawyers argue the comments violate their client’s due-process rights and that the case should be dismissed.

The judge, army Col Jeffery Nance, didnot immediately rule on the defense request, but called the footage of Trump condemning Bergdahl “disturbing material”. A written decision was expected later.

Defense lawyers played about five minutes of the footage in which Trump repeatedly used phrases such as “no-good traitor” to refer to the soldier who was held captive by the Taliban and its allies for five years.

Bergdahl sat mostly still during the video presentation, looking away at times. By the end of the footage, the muscles in Bergdahl’s jaw were visibly bulging as he apparently clenched his teeth.

Prosecutors say Trump’s comments amounted to campaign rhetoric against actions taken by the Obama administration to bring Bergdahl home.

“These comments are clearly intended to try to attack a political opponent for political gain,” said army Maj Justin Oshana, a prosecutor.

The Obama administration’s decision in May 2014 to exchange Bergdahl for five Taliban prisoners prompted some Republicans to accuse Obama of jeopardizing the nation’s safety.

Barack Obama stands with Bowe’s parents, Jani and Bob Bergdahl, in May 2014 during a news conference about the release of their son. Photograph: Carolyn Kaster/AP

Oshana said potential jurors’ exposure to Trump’s comments could be addressed through questioning during jury selection. He added that it would be unprecedented to dismiss the case without first trying to seat a jury.

But Nance asked, “how does that relate to overcoming the black eye to the military justice system … the view the public might have?”

That question goes to the heart of the defense argument that Trump’s comments constitute unlawful command influence by the new commander-in-chief. Even the appearance of such unfairness can theoretically derail a military case.

The defense’s motion, filed shortly after Trump was sworn in as president, cites more than 40 instances of Trump’s criticism at public appearances and media interviews through August 2016.

Eugene Fidell, Bergdahl’s defense attorney, argued o Monday that Trump has kept other campaign promises, so his comments about Bergdahl should be taken seriously. They played a clip of Trump promising his audience at a December 2015 campaign rally to review the case if Bergdahl got a light punishment.

Nance also took note of that statement, asking prosecutors: “You’re not at all concerned about the statement he made, ‘If I get in we will review his case’ … after ranting and raving about no jail time?”

A White House spokesman didnot immediately respond to a phone call and email seeking comment on Monday about whether Trump plans to review Bergdahl’s case.

Bergdahl is charged with desertion and misbehavior before the enemy, the latter of which carries a maximum penalty of life in prison. He has been assigned to desk duty at a Texas army base while awaiting trial.

Bergdahl, who is from Idaho, has said he walked off his post to cause alarm and draw attention to what he saw as problems with his unit.

His trial is scheduled for April, but a delay seems likely after the judge set a new time frame for working out problems with the handover of classified information as part of the discovery process. He said he would give lawyers until the beginning of April to prepare a status report that will determine future dates in the case.