Speaking to a group of police chiefs, Mr. Trump said his immigration order was “done for the security of our nation.”

President Donald Trump has slammed the court that is deliberating his immigration and refugee executive order as being “so political,” part of a relentless pounding of the judiciary branch that prompted a rebuke from his nominee for the Supreme Court.

Speaking to a group of police chiefs, Mr. Trump said his immigration order was “done for the security of our nation.” He quoted from the portion of the immigration law that he said gave him the power to enact the ban, calling it “beautifully written” and saying “a bad high school student would understand this.”

“Courts seem to be so political and it would be so great for our justice system if they would be able to read a statement and do what’s right,” he added. “And that has to do with the security of our country, which is so important.”

Mr. Trump’s comments come as the 9th US Circuit Court of Appeals is weighing the appeal of his executive order on immigration, including a temporary travel ban on people from seven Muslim-majority countries.

In a hearing on Tuesday, judges on the appeals court challenged the administration’s claim that the ban was motivated by terrorism fears, but also questioned an attorney’s argument that it unconstitutionally targeted Muslims.

Since a lower court judge blocked the order last week, Mr. Trump has criticised the decision. He labelled the judge in the case a “so-called judge” and called the ruling “ridiculous.”

Legal experts, Democrats and some Republicans criticised Mr. Trump’s remarks as jeopardising the independence of the judiciary and attempting to use political influence to sway the courts.

Mr. Trump’s nominee for the Supreme Court joined the criticism on Wednesday in a meeting with Sen Richard Blumenthal of Connecticut.

Blumenthal said Judge Neil Gorsuch described the president’s comments about the judiciary as “demoralising and disheartening.”

Gorsuch’s confirmation team confirmed the judge’s comments.

In his speech, Mr. Trump sought to link his comments about the court battle over his executive order to the law enforcement community in attendance.

“We have to allow you to do your job,” he said. “And we have to give you the weapons that you need, and this is a weapon that you need and they’re trying to take it away from you.”

The president has repeatedly said people are “pouring in” since the ban was put on hold and suggested that blocking the order would be dangerous for US citizens.

Last morning he tweeted, “Big increase in traffic into our country from certain areas, while our people are far more vulnerable, as we wait for what should be EASY D!”