On Saturday, Trump tweeted: "The opinion of this so-called judge, which essentially takes law-enforcement away from our country, is ridiculous and will be overturned!"

The order by District Judge James Robart is reported to present a major challenge to the new government.

After hearing arguments from Washington state and Minnesota too, which later joined the motion, Robart granted the temporary restraining order.

The two states had challenged Trump's executive order saying it was unconstitutional and unlawfully discriminates against Muslims and caused unreasonable harm.

"The state has met its burden in demonstrating immediate and irreparable injury," Robart, a George W Bush appointee, said. "This TRO (temporary restraining order) is granted on a nationwide basis ..."

Washington state attorney general Bob Ferguson said: "We are a nation of laws. Not even the president can violate the constitution.

"No one is above the law, not even the president. This decision shuts down the executive order immediately. That relief is immediate, happens right now. That's the bottom line."

The restraining order suggests that Trump's travel restrictions could be lifted straight away. However, it is not clear how it would be fulfilled. An internal email circulated among Homeland Security officials informed employees to comply with the ruling immediately, AP reported.

The White House released a statement late on Friday saying it would immediately request an emergency stay of Robart's "outrageous" order from taking effect. Spokesman Sean Spicer said Trump's order was intended to be "lawful and appropriate". Soon after, the White House sent out a new statement that removed the word "outrageous."

In his order, Robart wrote that the states had shown "immediate and irreparable injury" caused by Trump's ban,

"The executive order adversely affects the states' residents in areas of employments, education, business, family relations and freedom to travel," he wrote.

While several federal judges have temporarily blocked deporting visa holders, the Seattle judge's ruling is the first to be applicable nationwide.

Four other US states — Virginia, Massachusetts, Michigan and New York — are also hearing cases that have challenged the president's executive order.

Meanwhile on Friday, a judge in Boston declined to extend a temporary restraining order that blocked the detention or removal of foreigners who were legally permitted to come into the US. The ban, which applied only to Massachusetts is said to expire on 5 February.