During a rally while campaigning for president, Mr Trump even mimicked the sound of a rifle shot saying "bing, bong!" while pretending to fire a gun at Bergdahl.

These statements will now be considered by the judge sentencing the 31-year-old soldier and may result in a lighter punishment.

The judge did not allow the case to be dismissed or for the sentence to be capped because of the President's comments, as he said he had not been influenced by Mr Trump's comments and he didn't think public confidence in the military justice system had been undermined.

But the comments will be taken into consideration during sentencing.

"I will consider the president's comments as mitigation evidence as I arrive at an appropriate sentence," the judge, Colonel Jeffery R. Nance of the Army, reportedly said during the hearing last month at Fort Bragg.

The prosecutors have asked the judge to sentence Bergdahl to 14 years in prison, citing serious wounds to service members who looked for Bergdahl.

But defence attorneys argued Bergdahl already suffered enough confinement during his five years of brutal captivity by Taliban allies. They asked the judge to give their client a dishonourable discharge and no prison time. Their argument for leniency also cited harsh campaign-trail criticism by Donald Trump and Bergdahl's mental disorders.

The judge began his deliberations about the punishment on Thursday but it is not clear when he will deliver the sentence.

The military system is different to the country's federal criminal but as legal news website Above The Law pointed out: "when the President of the United States says you should be killed before you've even been tried, it causes real problems for the administration of justice".

When it comes to Saipov's case, proving that the President's comments have not harmed the man's chance of a fair trial may come down to the judge ruling that people don't listen to or respect Mr Trump's comments, according to executive editor Elie Mystal.

"At the very least, Trump has probably already made it so Saipov cannot be put to death," he wrote.

Other legal experts believe the President's remarks will not slow the case or throw it off track.

"Nothing slows down the train," said James Cohen, a professor at Fordham Law School.
He said the yet-to-be-assigned judge will question prospective jurors to ensure they can be fair despite anything they might have heard or read.

Karen Greenberg, director of the Center on National Security at Fordham Law School and a frequent observer at terrorism trials, said: "Because this is in federal court, this will happen both speedily and without it interfering with the normal process of the trial".

Regardless of whether Mr Trump's comments have any bearing on the outcome of these cases, ultimately they seem unlikely to achieve anything except make the President appear either irrelevant or incompetent.