A US court unanimously refused to reinstate Donald Trump’s ban on refugees and nationals from seven Muslim-majority countries, dealing the new president and his controversial law-and-order agenda a major defeat.

The ruling from the federal appeals court in San Francisco on Trump’s executive order, issued on January 27 with no prior warning and suspended by a lower court a week later, capped a turbulent first three weeks of his presidency.

A defiant Trump quickly pledged to battle on, tweeting within minutes of the decision: “SEE YOU IN COURT, THE SECURITY OF OUR NATION IS AT STAKE!”

The Justice Department had asked the Ninth Circuit Court of Appeals to restore the measure on an emergency basis, but the three-judge panel instead maintained the suspension ordered by a federal judge in Seattle.

“We hold that the government has not shown a likelihood of success on the merits of its appeal, nor has it shown that failure to enter a stay would cause irreparable injury,” the judges ruled.

Trump’s decree summarily denied entry to all refugees for 120 days, and travelers from Iran, Iraq, Libya, Somalia, Sudan, Syria and Yemen for 90 days. Refugees from Syria were blocked indefinitely.

The new Republican administration argued the ban was needed to prevent Islamic State and Al-Qaeda fighters migrating from reaching US soil, but it sparked travel chaos and was roundly rejected by immigration advocacy groups.

Critics say the measure targeted Muslims in violation of US law.

Now, the case could end up in the Supreme Court.

– Court’s logic –

The court in San Francisco said aspects of the public interest favored both sides, highlighting the “massive attention” the case had drawn.

“On the one hand, the public has a powerful interest in national security and in the ability of an elected president to enact policies,” the ruling said.

“And on the other, the public also has an interest in free flow of travel, in avoiding separation of families, and in freedom from discrimination.”