Some legal scholars who reviewed it said the Justice Department could face long odds in any immediate appeal to the US Supreme Court, though that won't necessarily stop the administration from trying. Mr Trump tweeted "SEE YOU IN COURT" after the ruling came out on Thursday - prompting a sharp retort from Jay Inslee, the Washington state governor: "Mr. President, we just saw you in court, and we beat you."

Here's a look at the legal issues in the court's ruling and what comes next.

What does the ruling mean?

For now, it means refugees and people from seven majority-Muslim nations identified in the president's surprise January 27 executive order can continue entering the country.

Travellers from those countries won't be detained, or put back on planes heading overseas, and protests which jammed the nation's airports after Mr Trump issued the surprise order, should subside.

But the executive order isn't dead, either - it just isn't being enforced while the courts debate its legality. The federal government has 14 days to ask the 9th Circuit to reconsider Thursday's decision.

It could also file an emergency appeal with the US Supreme Court, which would go to Justice Anthony Kennedy for referral to the rest of the court.

Rory Little, a former Supreme Court clerk who teaches at the University of California Hastings College of the Law, doesn't think that's such a good idea.

In addition to seeking to overturn a reasoned decision, he said, Mr Trump would be facing Chief Justice John Roberts, who just wrote an annual report in which he raved about his District Court judges.

Judge Richard Clifton, Judge William Canby and Judge Michelle Friedland from the Ninth Circuit Court of Appeals in San Francisco refused to restore US President Donald Trump's controversial executive order closing US borders to refugees and nationals from seven Muslim-majority countriesCredit:
AFP

The president repeatedly insulted the Seattle judge who ruled against him, in addition to the appeals judges who followed suit.

"I think Kennedy and Roberts are seething about the president insulting their judges," Mr Little said. "If they go to the US Supreme Court, they risk getting a serious adverse ruling."

What did the court consider?

There have been, in effect, two items before the court: the government's appeal of the lower judge's ruling, and its motion to put that ruling on hold pending the appeal. On Thursday, the panel denied the motion for stay and set a briefing schedule for fuller arguments on the merits of the appeal.

People on both sides have strong feelings on this issue, but we should all agree on the Constitution. - BF pic.twitter.com/zXCNLGqjpY

That prompted some confusion among those watching the case, many of whom expected it to be returned to the Seattle courthouse. Washington's lawyer, state Solicitor General Noah Purcell, wrote to the Seattle court's clerk late Thursday to note the state wouldn't be making an expected court filing because of the new appellate briefing schedule.

Barring an immediate appeal to the Supreme Court, the government's opening brief is due March 3, with the states' filing due March 24.

In denying the motion for stay, the court said it was considering whether the administration was likely to win its appeal, whether suspending the travel ban had harmed the government, and whether the public interest favored granting the stay or rejecting it.

The judges agreed that the lower court's ruling was appealable - the only question on which the states lost. They rejected the DOJ's argument that the states lacked standing to sue, noting that some faculty members at state universities were unable to travel, for example.

But most forcibly, they rejected the DOJ's notion that the president has nearly unlimited authority over immigration decisions.

"There is no precedent to support this claimed unreviewability, which runs contrary to the fundamental structure of our constitutional democracy," the opinion said.

A problematic executive order?

Based on what they know so far, Mr Trump's executive order poses some serious constitutional concerns, the panel said. For example, the government hasn't shown that it complies with due process, by giving those affected notice or a hearing before restricting their ability to travel.

While the government insisted that most or all those affected don't have such rights, the court disagreed. The protections of the Fifth Amendment's due process clause aren't limited to US citizens, the judges said.

Furthermore, while the White House Counsel Donald McGahn issued guidance days after the executive order saying it didn't apply to legal permanent residents of the US, some of whom had been caught up in the travel ban, that guidance was of little use, the court wrote.

"The Government has offered no authority establishing that the White House counsel is empowered to issue an amended order superseding the Executive Order signed by the President," the opinion said.

"The White House counsel is not the president, and he is not known to be in the chain of command for any of the Executive Departments."

A liberal court?

Many conservatives denounced the ruling, and some law professors criticized various aspects of it, including its lack of analysis regarding a law giving the president power to suspend entry of "any class of aliens" when he finds their entry "would be detrimental" to the country.

Republican Sen. Tom Cotton of Arkansas called the decision misguided and wrote off the court it came from as "the most notoriously left-wing court in America."

While the 9th Circuit certainly has a lefty reputation, based in part on the long tenure of the many liberal judges that Democratic President Jimmy Carter appointed, legal scholars say the label is less deserved than it used to be. Two of the judges on the panel that made the ruling are Democratic appointees, while one, that Judge Richard Clifton, was appointed by President George W. Bush.

Judge Richard CliftonCredit:
AP

Carl Tobias, a law professor at the University of Richmond Law School, said Clifton's decision to join the opinion should allay any concerns that it was motivated by politics instead of the law. That should make the government think twice before going to the Supreme Court, he said.

During oral arguments Tuesday, Clifton "was asking the best questions that might lean toward the government, but even he wasn't persuaded on the law or the facts, so that makes it really tough for the government," Tobias said.

"I don't think they're going to be well-received at the Supreme Court for all kinds of reasons, but mainly because this is a reasonable decision. The precedents are there, they've weighed the issues, and even Clifton signed it."

What does the ruling say?

At issue in this emergency proceeding is Executive Order 13769, “Protecting the Nation From Foreign Terrorist Entry Into the United States,” which, among other changes to immigration policies and procedures, bans for 90 days the entry into the United States of individuals from seven countries.

Two States challenged the Executive Order as unconstitutional and violative of federal law, and a federal district court preliminarily ruled in their favor and temporarily enjoined enforcement of the Executive Order.

The Government now moves for an emergency stay of the district court’s temporary restraining order while its appeal of that order proceeds.

To rule on the Government’s motion, we must consider several factors, including whether the Government has shown that it is likely to succeed on the merits of its appeal, the degree of hardship caused by a stay or its denial, and the public interest in granting or denying a stay.

We assess those factors in light of the limited evidence put forward by both parties at this very preliminary stage and are mindful that our analysis of the hardships and public interest in this case involves particularly sensitive and weighty concerns on both sides.

Nevertheless, 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, and we therefore deny its emergency motion for a stay.