US president Donald Trump has lost an appeal against a court ruling blocking his travel ban on certain travellers and all refugees.

The 9th US circuit court of appeals in San Francisco instead asked both the state of Washington and the Trump administration early on Sunday to file more arguments by Monday afternoon.

The Trump administration had launched an appeal againt a federal judge’s ruling that temporarily placed the ban on hold. The higher court’s denial of an immediate stay means legal battles over the ban will continue into the coming week at least.

Acting solicitor general Noel Francisco forcefully argued in the government’s brief on Saturday night that presidential authority is “largely immune from judicial control” when it comes to deciding who can enter or stay in the United States.

Mr Trump acted after a judge in Washington state temporarily blocked his refugee and immigration ban, involving seven Muslim-majority countries in an extraordinary setback for the White House.

It was forced to suspend enforcement of the ban, and Mr Trump launched a series of vitriolic attacks on US district judge James Robart.

The president told reporters, when asked about the appeal: “We’ll win. For the safety of the country, we’ll win.”

The US justice department’s appeal said it is a basic principle that “an alien seeking initial admission to the United States requests a privilege and has no constitutional rights regarding his application”.

The US justice department asked that the judge’s order be stayed pending appeal.

As the White House worked to reinstate the ban, Mr Trump mocked Judge Robart, appointed by former US president George Bush, on Twitter as a “so-called judge” whose “ridiculous” ruling “will be overturned”.

He added in a subsequent tweet: “Because the ban was lifted by a judge, many very bad and dangerous people may be pouring into our country. A terrible decision.”

Mr Trump’s direct attack recalled his diatribes during the campaign against a judge of Mexican heritage who was overseeing a Trump University case.

Justice department lawyers could be called upon to answer for his words as the travel ban case reaches the appeal court.

Unending confusion

The ban has caused unending confusion for many foreigners trying to reach the United States, prompting protests across the US and leading to multiple court challenges.

Demonstrations took place outside the White House, in New York and near Mr Trump’s estate in Palm Beach, Florida, where he was spending the weekend and attending an annual American Red Cross fundraising gala.

The US state department, after initially saying that as many as 60,000 foreigners from Iraq, Syria, Iran, Sudan, Libya, Somalia or Yemen had their visas cancelled, reversed course on Saturday and said they could travel to the US if they had a valid visa.

The department advised refugee aid agencies that refugees set to travel before Mr Trump signed his order will now be allowed into the US.

A state department official said that the government was “focusing on booking refugee travel” through February 17th and working to have arrivals resume as soon as Monday.

The Homeland security department was no longer directing airlines to prevent visa-holders affected by Mr Trump’s order from boarding US-bound planes.

The agency said it had “suspended any and all actions” related to putting in place Mr Trump’s order, which the White House argued was “intended to protect the homeland”.

Mr Trump made clear what he thought of Judge Robart’s action.

“The opinion of this so-called judge, which essentially takes law-enforcement away from our country, is ridiculous and will be overturned,” he tweeted.

“When a country is no longer able to say who can and who cannot come in & out, especially for reasons of safety & security — big trouble!”

After a pause of several hours, the president returned to Twitter: “What is our country coming to when a judge can halt a Homeland Security travel ban and anyone, even with bad intentions, can come into US?”

Senator Patrick Leahy, a Democratic member of the Senate Judiciary Committee, criticised Mr Trump for “attempting to bully and disparage yet another federal judge”.

He said the president seemed “intent on precipitating a constitutional crisis”.

AP