US president Donald Trump has promised more legal action after a federal appeals court refused to reinstate his ban on travellers from seven predominantly Muslim nations.
Mr Trump tweeted "SEE YOU IN COURT" after the decision came out on Thursday, but what he has in mind remains to be seen.
He said on Friday that he has "no doubt" he will win the case in court and told reporters he is considering signing a "brand-new order" on immigration.
The 3-0 ruling means that refugees and people from the seven nations - Iran, Iraq, Libya, Somalia, Sudan, Syria and Yemen - can continue entering the United States for now.
The administration has several options on how to proceed. Here is a look at where the legal fight goes from here:
REHEARING AT THE APPEALS COURT
The Trump administration could decide to ask the 9th US Circuit Court of Appeals to reconsider the three-judge panel's ruling.
But the odds of success seem low, said Margo Schlanger, a law professor at the University of Michigan.
She noted that the three-judge panel was unanimous and included a judge chosen by a Republican president.
SUPREME COURT APPEAL
The government could file an emergency appeal to the Supreme Court and ask the justices to restore the ban.
But it would take at least five justices to overturn the ruling from the 9th US Circuit Court of Appeals and that may be a long shot.
The high court still has only eight members since the death of Justice Antonin Scalia - four conservative and four liberal justices.
"There are almost surely four votes to deny an emergency request to reinstate the order," said Peter Spiro, a law professor at Temple University.
The last immigration case to reach the justices ended in a 4-4 deadlock last year.
That suggests a similar split over Mr Trump's order, which would let the 9th Circuit ruling stand and keep the freeze in place.
WAITING FOR GORSUCH
If the Supreme Court declines to intervene right away, the case would remain in the 9th Circuit and ultimately be considered on its legal merits.
It also could return to US District Judge James Robart in Seattle, who temporarily blocked the ban after Washington state and Minnesota urged a nationwide hold on the January 27 order.
The lower court action so far is temporary and has not resolved broader questions about the legality of Mr Trump's order.
It simply halts deportations or other actions until judges can more fully consider whether the order violates legal or constitutional rights.
Allowing the case to play out longer at the appeals court has one advantage: By the time a ruling on the merits comes down, the Senate may have confirmed Judge Neil Gorsuch to the Supreme Court.
That may improve Mr Trump's chances to prevail on appeal.
But just how the issue might reach the Supreme Court is not clear. Several other challenges have been launched in courts around the country, and the court could opt to wait before stepping in.
REVISING THE EXECUTIVE ORDER
The White House could amend the executive order to expressly carve out existing green card holders and other people that already have some ties to the United States.
Up to 60,000 visas were initially cancelled in the wake of the ban, affecting the lives of students, professors and workers.
White House counsel Donald McGahn had issued guidance days after the executive order saying it did not apply to legal permanent residents of the US, but the appeals court said that was not enough.
"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.
Revising the order "shifts the legal boundaries so that it becomes a tougher constitutional target", Mr Spiro said.
The appeals court issued a sharp rebuke to the Justice Department's argument that the president has the constitutional power to restrict entry to the United States to prevent terrorism, and that courts cannot second-guess that authority.
"There is no precedent to support this claimed unreviewability, which runs contrary to the fundamental structure of our constitutional democracy," the opinion said.
Washington state, Minnesota and other states say Mr Trump showed his intent in the presidential campaign when he called for a ban on Muslims entering the country.
They also say his order discriminates against Muslims because it provides exceptions for refugees who practice a religion that makes them a minority in their home country. That would favour Christians in the countries affected.
The appeals court said the administration failed to show that the order satisfied constitutional requirements to provide notice or a hearing before restricting travel. But it did not rule on whether the order violated religious protections under the First Amendment.
Justice Department lawyer Erez Reuveni told a Virginia judge hearing arguments in a similar case on Friday that the administration has not decided what to do.