A legal showdown was brewing Sunday after the US Justice Department appealed a temporary block on Donald Trump's contentious travel ban but the court rejected any immediate move to reinstate it.
The early morning ruling by a federal appeals court was the latest in a series of dramatic twists in the saga which began on January 27 when the Republican president issued a blanket ban on refugees and travelers from seven mainly-Muslim nations.
As the fierce legal battle over the order played out, thousands of people around the world, from London to Washington, demonstrated against the ban.
There was no immediate reaction from the White House but ahead of the ruling Trump had assured reporters his ban would be reinstated.
"We'll win. For the safety of the country, we'll win," he said.
Earlier, the Manhattan property mogul had unleashed a string of fiery tweets defending his policy and attacking federal judge James Robart who had on Friday blocked the ban nationwide pending a wider legal review.
"The opinion of this so-called judge, which essentially takes law-enforcement away from our country, is ridiculous and will be overturned!" Trump wrote on Twitter.
"The judge opens up our country to potential terrorists and others that do not have our best interests at heart. Bad people are very happy!"
With the ban temporarily halted, travelers from the targeted countries with valid visas began arriving on American soil, while others prepared to set off for the United States.
In an appeal filed late Saturday, the Justice Department said that suspending the ban was causing "irreparable harm" to the American public.
It said Robart's ruling had run afoul of constitutional separation of powers, and "second-guesses the president's national security judgment."
But on Sunday morning, the Ninth Circuit Court of Appeals rejected a request calling for the travel ban to be immediately reinstated.
Judges William Canby, Jr and Michelle Friedland did not give a reason in their two-paragraph ruling.
However, they told the states of Washington and Minnesota, which had filed the original suit against the ban, to provide documents detailing their opposition to the government's appeal by 11:59 pm Sunday (0759 GMT Monday).
And the Justice Department was given until 3:00 pm on Monday (2300 GMT) to supply more documents supporting its position.
Meanwhile, in line with Robart's ruling, government authorities on Saturday began reopening borders to those with proper travel documents.
The State Department told visa holders from Iran, Iraq, Libya, Somalia, Sudan, Syria and Yemen that they are allowed to travel as long as their documents had not been "physically cancelled."
The department had earlier said up to 60,000 people had their visas revoked as a result of Trump's order, although a Justice Department attorney put the number at closer to 100,000.
The Department of Homeland Security -- which runs border agencies -- also said it would cease implementing the order.
In addition to slapping a blanket ban on entry for nationals of the seven countries for 90 days, Trump's order also barred refugees for 120 days.
Refugees from Syria were blocked indefinitely.
A 30-year-old Iranian woman told AFP she had rebooked her tickets to the United States and was ready to travel Sunday night to see her brother.
"Until yesterday, I was completely disappointed. We have some new hope after this news, but it's 50-50. I am willing to take this risk," said the woman, who did not want to give her name.
The restrictions had wreaked havoc at airports across America and beyond, leaving travelers trying to reach the United States in limbo.
The political backlash for Trump has been equally severe, with the order fueling numerous mass protests and White House infighting.
In Washington, hundreds marched from the White House to Capitol Hill, chanting "Donald, Donald, can't you see -- we don't want you in DC!"
Another 3,000 people rallied in New York, while an estimated 10,000 people turned out in London and smaller gatherings took place in Paris, Berlin, Stockholm and Barcelona.
Trump was forced to defend a botched rollout of the plan -- which called his government's competence into question -- and fired the acting attorney general for refusing to defend the order in court.
His approval rating has sunk to the lowest level on record for any new president.
His latest Twitter tirade is only likely to stoke the controversy.
Presidents from Thomas Jefferson to Barack Obama have criticized court rulings, but have rarely, if ever, criticized individual judges.
"I can't think of anything like it in the past century and a half," constitutional scholar and Harvard Law professor Laurence Tribe told AFP.
"It's not exactly contempt of court, but it certainly is contemptuous.
"It conveys a lack of respect for the independent judiciary that bodes ill for the country's future as long as Trump occupies the presidency."
Ineffective at best
Democrats in Congress were swift in their condemnation of Trump's remarks, while Republicans notably did not rush to his defense.
"This 'so-called' judge was nominated by a 'so-called' President & was confirmed by the 'so-called' Senate. Read the 'so-called' Constitution," tweeted California Democratic lawmaker Adam Schiff.
The White House has argued that the travel bans are needed in order to prevent terror attacks on the United States.
Experts from the fields of intelligence, counterterrorism and diplomacy say the ban is at best ineffective and at worst fuels hatred of the United States in the Middle East.