Donald Trump's executive order on immigration has legal experts grappling with a key question: how broad is the US president's reach when it comes to shaping migration policy?
Trump's decree slapped a blanket ban on entry for nationals of seven predominantly Muslim countries for 90 days and barred all refugees for 120 days. Refugees from Syria were blocked indefinitely.
But a federal judge issued a temporary nationwide suspension of the president's order, which the US government swiftly appealed.
The ultimate ruling in the case could clear confusion regarding Trump's executive reach and leave a lasting legal impact. Here is a look at the process:
Who will decide?
There is a chance the case will go all the way to the Supreme Court, the nation's top bench that is the final interpreter of US constitutional law.
For now, all eyes are on the Ninth Circuit Court of Appeals, based in San Francisco, as it weighs the order temporarily halting the ban nationwide, issued by Seattle federal judge James Robart.
A hearing before three judges on the court -- two of whom were appointed by Democratic presidents, and one by a Republican -- took place Tuesday and a decision could come as early as Wednesday.
As a federal judge, Robart's ruling has nationwide validity. While several other federal judges had previously issued rulings on narrow aspects of Trump's executive order, his was the first to address it as a whole.
Who is involved?
The Trump administration has challenged Robart's ruling by filing an emergency motion with the Ninth Circuit Court of Appeals saying that suspending the ban harms national security.
The primary plaintiffs are two Democratic-leaning states that border Canada: Washington, where Robart sits, and Minnesota. They were backed in a court brief filed by 16 state attorneys general.
A number of groups have filed briefs backing the states' efforts, including the American Civil Liberties Union, the Southern Poverty Law Center -- which monitors extremism in the US -- and the HIAS refugee protection organization.
Nearly 300 law professors and some 130 Silicon Valley firms have also submitted arguments supporting Robart's opinion.
Trump has dismissed Robart as "a so-called judge" and voiced confidence that his ruling would be overturned.
What are their arguments?
Trump justifies his decree by invoking Article II of the Constitution, which grants the president authority to direct immigration policy and conduct foreign affairs.
The US government has defended the president's travel ban as a "lawful exercise" of his authority, and claims the federal court erred in barring enforcement of the measure.
Trump's argument is also founded in part on a 65-year-old provision of the federal Immigration and Nationality Act, which allows the president to suspend US entry of any category of foreigners whose presence he deems "detrimental to the interests of the United States."
Government lawyers are trying to bolster this argument by saying that the judiciary is unqualified to decide on national security matters.
"Unlike the president, courts do not have access to classified information about the threat posed by terrorist organizations operating in particular nations, the efforts of those organizations to infiltrate the United States, or gaps in the vetting process," they wrote in their appeal.
Those opposed to the White House decree also cite the Constitution, saying that the executive order violates its fundamental principles including those on equality, freedom of movement and freedom of religion.
They also emphasize that the role of the judicial branch is to check the power of the executive, especially to protect minorities.
The states pin the legitimacy of their complaint on the fact that Trump's ban affects them through its negative consequences on employment, business and education.
They also warn that reinstating the ban could threaten public order, considering the chaos that broke out, especially in airports, following its hurried implementation.
What happens next?
The appeals court can opt to reinstate the ban, confirm its suspension -- or schedule an additional hearing.
If the ban is restored, authorities have yet to indicate whether they have taken steps to avoid a repeat of the airport detentions and deportations which fueled international outrage and mass protests the first time around.
If the court takes the second option, Robart's decision would remain in place nationwide, keeping the US open to refugees and travellers from the seven targeted countries.
The losing party would be able to request the Supreme Court to take on the case.
If the nation's highest court accepts, five of the eight total judges would be required to reverse the decision from the Court of Appeals.
Achieving that majority poses a challenge: the Supreme Court is currently ideologically split between four conservatives and four progressives.
Trump has nominated a conservative, Neil Gorsuch, to fill the vacant ninth seat. But he must first get confirmed by the Senate.