WASHINGTON (CNN) — President Donald Trump’s government moved swiftly Saturday to comply with a federal judge’s order halting his travel ban — even as Trump himself denounced the judge — but readied its legal defense of the controversial executive action.

The Department of Homeland Security announced it has suspended all actions to implement the immigration order and will resume standard inspections of travelers as it did prior to the signing of the travel ban. But it said the Justice Department — which is expected to file an emergency motion to stop the order — needed to challenge the ruling “at the earliest possible time.”

“(Trump’s order) is intended to protect the homeland and the American people, and the President has no higher duty and responsibility than to do so,” acting DHS press secretary Gillian Christensen said when announcing the suspension.

But already, the nation was in the midst of a second straight weekend of widespread uncertainty over the controversial ban, this time with the administration on defense.

A State Department official told CNN the department has reversed the cancellation of visas that were provisionally revoked following the President’s executive order last week — so long as those visas were not stamped or marked as canceled.

The department transmitted a cable to all posts Saturday instructing them to resume the visa process as they had before the executive order, two senior State Department officials said.

The officials told CNN those whose visas were physically canceled would have to go to an embassy or consulate to have them reinstated. Most cancellations were done electronically and reinstated electronically, they said.

The State Department has said fewer than 60,000 visas were revoked since the signing of the order. It was not immediately clear how many from that group will continue to be without their visas because their visas were physically canceled.

Following the judge’s ruling — and before the government’s announcements Saturday morning — the International Air Transportation Association, a worldwide airline industry trade group, cited US Customs and Border Protection in telling its members to follow procedures “as if the executive order never existed.”

Trump’s order bars citizens of seven Muslim-majority countries — Iraq, Syria, Iran, Libya, Somalia, Sudan and Yemen — from entering the US for 90 days, all refugees for 120 days and indefinitely halts refugees from Syria.

‘Outrageous’ order

Federal Judge James Robart, a George W. Bush appointee who presides in Seattle, halted the enforcement of Trump’s order Friday night, effective nationwide.

Robart, ruling in a lawsuit brought by the attorneys general of Washington state and Minnesota who sought to stop the order, said the states “have met their burden of demonstrating that they face immediate and irreparable injury as a result of the signing and implementation of the Executive Order. ”

He said the order adversely affects residents in areas of education, employment, education and freedom to travel.

Washington state Attorney General Bob Ferguson told CNN’s Anderson Cooper Friday night that he was prepared to take his case all the way to the Supreme Court if necessary.

Robart’s decision was met with swift denunciation by the White House — which originally called it “outrageous” before removing that word in a statement issued minutes later — and Trump himself, who blasted the judge personally Saturday morning.

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

Trump also sent out a series of tweets lamenting the ruling.

“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!” he tweeted.

Robart’s ruling may have stung even more for the Trump administration because it came on the heels of its first legal victory over the travel ban. Hours earlier Friday, a federal judge in Boston issued a more limited ruling that declined to renew a temporary restraining order in Massachusetts, which would have prohibited the detention or removal of foreign travelers legally authorized to come to the Boston area.

But it was the sweeping ruling from Seattle that had the federal government scrambling.

Visas to be reinstated

CBP alerted airlines Friday night that the US government would quickly begin reinstating visas that were previously canceled, and it advised airlines that refugees in possession of US visas will be admitted as well, an airline executive said.

CBP told major US airlines Friday night that the government is in the process of reinstating visas and is “back to business as usual” before the situation that was in place before last week’s executive order, the airline executive told CNN. Airlines were expected to remove travel alerts from their websites and get messages out to customers to alert them about the change.

It is possible there will be more court activity and an appeal before anyone could act on getting a visa, and it’s unclear how long it would take to obtain one.

US airlines use an automated system connected to the Customs and Border Protection database to scan passports and visas to get an instant determination if the passenger can board or not. Unless the government reinstates visas and the airlines get a “board” status, the airlines still would not allow such passengers to board.

Airlines were adjusting to the new developments Saturday. Qatar Airways announced it will allow nationals from the seven countries affected by Trump’s travel ban and all refugees presenting a valid, unexpired US visa or green card to travel to the United States.

Refugee groups relieved

Refugee resettlement agencies across the US welcomed Robart’s ruling.

“President Trump’s ban against refugees and Muslims was not only un-American, but Judge Robart found it to be unconstitutional,” Mark Hetfield, president and CEO of the Hebrew Immigrant Aid Society, told CNN on Saturday. “Thanks to Judge Robart’s order protecting the Constitution, thousands of refugees who were bound for the US can finally find protection — and a warm welcome — here.”

“But this won’t be the end of our fight to keep America’s door open to refugees,” he added.

Because of the logistical coordination required to organize refugee arrivals, resettlement groups reached by CNN did not expect them to resume immediately.

Once a refugee is vetted and approved for resettlement, the agencies coordinate with the International Organizations for Migration to arrange their placement with a local chapter. The UN’s Office of the High Commissioner for Refugees is involved in that process, as are the Departments of State and Homeland Security, and the government of the country from which refugees are applying.

Resettlement agencies have been working with the State Department’s Bureau of Population Refugees and Migration to determine when admissions can resume while local branches prepare to welcome the new arrivals.

Daniel Smith, an immigration attorney in Seattle, predicted a “flood of people trying to enter the US over the next few days” due to the legal opening.

“I am advising clients who are in the country now — don’t leave,” Smith said. “And any clients wanting to enter the country, it’s best if you try to get in right now and then stay put if you get here.”

Likely to affect Gorsuch confirmation process

Senate Minority Leader Chuck Schumer said Trump’s criticism of the judge will be cited in the Supreme Court nomination of Neil Gorsuch.

“The President’s attack on Judge James Robart, a Bush appointee who passed with 99 votes, shows a disdain for an independent judiciary that doesn’t always bend to his wishes and a continued lack of respect for the Constitution, making it more important that the Supreme Court serve as an independent check on the administration,” Schumer said in a statement.

“With each action testing the Constitution, and each personal attack on a judge, President Trump raises the bar even higher for Judge Gorsuch’s nomination to serve on the Supreme Court. His ability to be an independent check will be front and center throughout the confirmation process.”

And Vermont Sen. Patrick Leahy, the ranking Democrat on the Senate Judiciary Committee, said in a statement, “We need a nominee for the Supreme Court willing to demonstrate he or she will not cower to an overreaching executive.

“This makes it even more important that Judge Gorsuch, and every other judge this President may nominate, demonstrates the ability to be an independent check and balance on an administration that shamefully and harmfully seems to reject the very concept.”