Donald Trump’s executive order suspending refugee admissions and banning travel to the US from seven Muslim-majority countries has produced a showdown in federal court and an unusually high-stakes test for the new presidency.

An appeals court ruling expected as early as Tuesday could sustain the current national suspension of the controversial executive order, setting up what could be a long-shot appeal to the supreme court by the White House.

Alternatively, the appeals court might vindicate Trump’s ban, making a supreme court showdown perhaps even more likely. Or the case could return to litigation in the federal court for the western district of Washington, where it originated.

As we wait for the ruling from the US ninth circuit court of appeals, in San Francisco, here’s an explanation of how we got here, what’s at stake and what might happen next.

How did we get here?

Trump issued an executive order on 27 January, suspending refugee admissions and banning travel from Iran, Iraq, Syria, Libya, Somalia, Sudan and Yemen for 90 days. The order immediately came under legal attack from plaintiffs on all sides – travelers caught up in the ban, civil rights groups, and states arguing that irreparable harm had been done to residents.

US travel ban - a brief guide The executive order signed by Donald Trump suspends the entire US refugee admissions system, already one of the most rigorous in the world, for 120 days. It also suspends the Syrian refugee program indefinitely, and bans entry to the US to people from seven majority-Muslim countries – Iran, Iraq, Libya, Somalia, Sudan, Syria and Yemen – for 90 days. The order has prompted a series of legal challenges, while thousands of Americans have protested outside airports and courthouses in solidarity with Muslims and migrants.

The cases produced multiple rulings, for and against the various plaintiffs. The broadest relief of all was granted by district judge James Robart, in Seattle, last Friday. Robart, in a ruling that did not explain his deliberations, granted a request for a nationwide order restraining the federal government from enforcing the key planks of Trump’s order.

The ruling set up a major fight. Over the weekend, the justice department asked for an emergency hold on the Seattle ruling, which was denied, making the case a focus of national attention.

The justice department now has until 6pm ET on Monday to submit its final briefs to the appeals court, which is expected to rule shortly thereafter.

What will the appeals court decision mean?

If the appeals court rules against the justice department, the federal government must then decide whether to appeal again, asking the supreme court to weigh in.

But to overturn the lower court, a 5-3 supreme court ruling would be required – difficult math for Trump, in the eyes of most court analysts. The White House might wait to appeal the ruling until Trump’s current supreme court nominee, judge Neil Gorsuch, could be confirmed by the Senate. Or the justice department could shift its strategy elsewhere.

“Whether this case remains the focus going forward will depend on how the ninth circuit rules and how this case and others proceed going forward,” said Brianne Gorod, chief counsel of the Constitutional Accountability Center in Washington DC. “There’s obviously continuing to be a lot of activity in a lot of different courts.”

Is this normal?

The overall struggle represents an unusually large legal quagmire that arrived for the Trump administration with unusual speed, said Gorod.

“The fact that we have this executive order that was issued right at the start of this administration, that has now been stayed in part by so many different courts and that might well be at the supreme court in the near term seems pretty unusual,” Gorod said, “and I think is testament to the significant problems with the executive order that President Trump issued.”

Can Trump’s order be stopped?

It has been stopped, temporarily. That’s why Trump is so mad on Twitter. But Trump’s travel ban may be restarted if the appeals court finds in the government’s favor. As a second policy reversal in a matter of days, that would create further confusion for immigration authorities and for travelers, which the court may take into account in making its decision.

The opinion of this so-called judge, which essentially takes law-enforcement away from our country, is ridiculous and will be overturned! — Donald J. Trump (@realDonaldTrump) February 4, 2017

What specific parts of the order did Judge Robart restrain?



The restraining order issued by the district court judge applies to five sections of Trump’s executive order. Together these sections comprise the most controversial parts of the order. Sequentially, they instruct officials to:



Suspend entry to the US, as immigrants and nonimmigrants, of people from seven Muslim-majority countries for 90 days, excluding foreign nationals traveling on diplomatic visas and certain other specialty visas



Suspend the US refugee admissions program for 120 days



Prioritize refugee claims made by individuals on the basis of religious-based persecution, provided that the religion of the individual is a minority religion in the individual’s country of nationality



Suspend the admission of Syrian refugees specifically



Admit individuals to the US as refugees on a case-by-case basis



What are the basic lines of argument?

In its original complaint, the state of Washington (soon joined by Minnesota) argued: “The order is tearing Washington families apart. Husbands are separated from wives, brothers are separated from sisters, and parents are separated from their children.”

The states argued that Trump’s executive order was “motivated by discriminatory animus” and violated guarantees against discrimination in both the Immigration and Nationality Act and the US constitution. The states further argued that the order violated the constitutional separation of church and state and the constitutional guarantee of due process before the law.

A vigil in front of the Lincoln Memorial on 4 February held in solidarity with protests against Donald Trump’s travel ban policy. Photograph: Zach Gibson/Getty Images

The justice department has countered that the judge’s blocking the order “contravenes the constitutional separation of powers; harms the public by thwarting enforcement of an executive order issued by the nation’s elected representative responsible for immigration matters and foreign affairs; and second-guesses the president’s national security judgment about the quantum of risk posed by the admission of certain classes of aliens and the best means of minimizing that risk”.

Which argument is stronger?

That’s for the court to decide, but there are signs – apart from the sheer number and force of the court challenges – that the executive order does not hold water, legally speaking. On Monday, a bipartisan group of former national security officials submitted a joint declaration to the appeals court stating: “In our professional opinion, the order was ill-conceived, poorly implemented and ill-explained.” Signatories included Madeleine Albright, Avril Haines, Michael Hayden, John Kerry, John McLaughlin, Lisa Monaco, Michael Morell, Janet Napolitano, Leon Panetta and Susan Rice.

On Sunday, 97 technology companies – “from Apple to Zynga”, as the plaintiffs put it – filed an amicus brief in support of the states.

What happens next?

Even if the states lose the appeals court ruling, the case may not head directly to the supreme court. The states may decide to continue litigating the case in the district court, seeking a slightly different type of relief from the restraining order granted by Judge Robart. The states could seek a preliminary injunction, which would also have the effect of suspending Trump’s executive order in the near term.

If the appeals court rules in favor of the states, the justice department may appeal to the supreme court, may hold off on an appeal until the supreme court landscape changes, or may mount a challenge in a different district court, or take as yet unforeseen action.