A federal appeals court denied early Sunday the Justice Department's request for an immediate reinstatement of President Donald Trump's ban on accepting certain travellers and all refugees.

The Trump administration appealed a temporary order restraining the ban nationwide, saying late Saturday night that the federal judge in Seattle overreached by "second-guessing" the president on a matter of national security.

Now the higher court's denial of an immediate stay means the legal battles over the ban will continue for days at least. The 9th U.S. Circuit Court of Appeals in San Francisco asked challengers of the ban to respond to the appeal, and for the Justice Department to file a counter-response by Monday afternoon.

The opinion of this so-called judge, which essentially takes law-enforcement away from our country, is ridiculous and will be overturned! —@realDonaldTrump

Interesting that certain Middle-Eastern countries agree with the ban. They know if certain people are allowed in it's death & destruction! —@realDonaldTrump

Acting Solicitor General Noel Francisco forcefully argued Saturday night that the president alone has the power to decide who can enter or stay in the United States — an assertion that appeared to invoke the wider battle to come over illegal immigration.

"The power to expel or exclude aliens is a fundamental sovereign attribute, delegated by Congress to the executive branch of government and largely immune from judicial control," the brief says.

Earlier Saturday, the government officially suspended the ban's enforcement in compliance with the order of U.S. District Judge James Robart. It marks an extraordinary setback for the new president, who only a week ago acted to suspend America's refugee program and halt immigration from seven Muslim-majority countries the government said raise terrorism concerns.

U.S. President Donald Trump signs an executive order to impose tighter vetting of travellers entering the United States on Jan. 27. The executive order imposes a four-month travel ban on refugees entering the U.S. and a 90-day hold on travellers from Syria, Iran and five other Muslim-majority countries. (Carlos Barria/Reuters)

Trump, meanwhile, mocked Robart, who was appointed by President George W. Bush, calling him a "so-called judge" whose "ridiculous" ruling "will be overturned."

"Because the ban was lifted by a judge, many very bad and dangerous people may be pouring into our country. A terrible decision," 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! —@realDonaldTrump

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! —@realDonaldTrump

Trump's direct attack recalled his diatribes during the campaign against the federal judge of Mexican heritage who oversaw lawsuits alleging fraud by Trump University, and may prompt some tough questions as these challenges rise through the courts.

But the government's brief repeatedly asserts that presidential authority cannot be questioned by judges once the nation's security is invoked.

Congress "vests complete discretion in the President" to impose conditions on alien entry, so Trump isn't legally required to justify such decisions, it says. His executive order said the ban is necessary for "protecting against terrorism," and that "is sufficient to end the matter."

The U.S. Justice Department asked that the federal judge's order be stayed pending resolution of the appeal, so that the ban can "ensure that those approved for admission do not intend to harm Americans and that they have no ties to terrorism."

The order had caused unending confusion for many foreigners trying to reach the United States, prompted protests across the country and led to multiple court challenges. Demonstrations took place outside the White House, in New York and near his estate in Palm Beach, Florida, where Trump was attending the annual American Red Cross fundraising gala.

"We'll win," Trump told reporters Saturday night. "For the safety of the country, we'll win."

Canadian and American lawyers comment on Friday's court ruling that put a temporary halt to the U.S. president's executive order 2:26

The 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 U.S. if they had a valid visa.

The department on Saturday advised refugee aid agencies that refugees set to travel before Trump signed his order will now be allowed in. A State Department official said in an email obtained by The Associated Press that the government was "focusing on booking refugee travel" through Feb. 17 and working to have arrivals resume as soon as Monday.

The Homeland Security Department no longer was directing airlines to prevent visa-holders affected by Trump's order from boarding U.S.-bound planes. The agency said it had "suspended any and all actions" related to putting in place Trump's order.

Protesters march from City Hall to Minute Maid Park in Houston, Texas, on Saturday to protest against Trump's policies. (Tim Warner/Getty Images)

Hearings have also been held in court challenges nationwide. Washington state and Minnesota argued that the temporary ban and the global suspension of the U.S. refugee program harmed residents and effectively mandated discrimination.

In his written order Friday, Robart said it's not the court's job to "create policy or judge the wisdom of any particular policy promoted by the other two branches," but rather, to make sure that an action taken by the government "comports with our country's laws."

The Justice Department countered that "judicial second-guessing of the President's national security determination in itself imposes substantial harm on the federal government and the nation at large."

Robart's order also imposes harm on U.S. citizens "by thwarting the legal effect of the public's chosen representative," it says.

​