He also appeared to question the legitimacy of the federal judge who issued the ruling.

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

The tweets came hours after a federal judge in Washington state temporarily blocked enforcement of Trump’s ban on entry to the United States for citizens of seven majority-Muslim countries and refugees from around the world.

U.S. District Judge James L. Robart wrote in his opinion that “fundamental” to the court’s work was “a vigilant recognition that it is but one of three equal branches of our federal government.”

Robart, a judge appointed by George W. Bush, said in his written order that U.S. officials should stop enforcing the key aspects of the ban: the halting of entry by citizens from certain countries and by refugees from around the world. He did not specifically address the matter of those whose visas already had been revoked.

Following the Friday-night ruling, government authorities immediately began communicating with airlines and taking steps that would allow travel by those previously barred from doing so, according to a U.S. official.

At the same time, though, the White House said in a statement that the Justice Department would “at the earliest possible time” file for an emergency stay of the “outrageous” ruling from the judge. Minutes later, it issued a similar statement omitting the word “outrageous.”

“The president’s order is intended to protect the homeland and he has the constitutional authority and responsibility to protect the American people,” the White House said.

Trump signed orders on Jan. 27 not only to suspend admission of all refugees into the United States for 120 days but also to implement “new vetting measures” to screen out “radical Islamic terrorists.” Refugee entry from Syria, however, would be suspended indefinitely, and all travel from Syria and six other nations — Iran, Iraq, Libya, Somalia, Sudan and Yemen — is suspended for 90 days. Trump also said he would give priority to Christian refugees over those of other religions, according to the Christian Broadcasting Network.

Hours after it was signed, Trump's executive order sparked massive protests at airports across the country, as reports surfaced that dozens of travelers from the affected countries, including green-card holders, were being detained.

The American Civil Liberties Union filed a lawsuit the following day challenging Trump’s order after two Iraqi men with immigrant visas were barred from entering the United States at New York's John F. Kennedy International Airport. Within hours, federal judge Ann M. Donnelly issued a stay to stop the deportations nationwide, noting there was a strong likelihood the order had violated the petitioners' rights to due process and equal protection by the Constitution.

DULLES, VA - At Dulles International Airport, Muhamad Alhaj Moustafa, M.D., an Internal Medicine resident at the Washington Hospital Center, welcomes home his wife, Nabila Alhaffar, who was traveling from Doha where she saw family but was prevented from coming back to the US because of President Trump's Executive Order on travel, in Dulles, Virginia Monday February 6, 2017. (Melina Mara/The Washington Post) DULLES, VA - At Dulles International Airport, Muhamad Alhaj Moustafa, M.D., an Internal Medicine resident at the Washington Hospital Center, welcomes home his wife, Nabila Alhaffar, who was traveling from Doha where she saw family but was prevented from coming back to the US because of President Trump's Executive Order on travel, in Dulles, Virginia Monday February 6, 2017. (Melina Mara/The Washington Post) DULLES, VA - FEBRUARY 6: Ammar Aziz, center, surrounded by family and friends arrives at Dulles International Airport with his brother Tareq, not pictured, on February 6, 2017 in Dulles, Va. The two brothers were denied entry last week after the travel ban and were just approved to enter the United States. (Ricky Carioti/The Washington Post) DULLES, VA - FEBRUARY 6: Tareq Aziz, front, hugs his father Aquel Aziz, rear, after arriving at Dulles International Airport with his brother Ammar on February 6, 2017 in Dulles, Va. The two brothers were denied entry last week after the travel ban and were just approved to enter the United States. (Ricky Carioti/The Washington Post) DULLES, VA - FEBRUARY 6: Zahro Warsma, of Louisville, Kentucky, right, goes to kiss her granddaughter Mirhaan Abdikaafi, 3, after arriving at Dulles International Airport from Somalia with her mom and two aunts on February 6, 2017 in Dulles, Va. Zahro's three daughters and grandchild were caught up in last week's travel ban. (Ricky Carioti/The Washington Post) GREENVILLE, SC - FEBRUARY 6, 2017: Nazanin Zinouri, an Iranian engineer, is received by supporters at the Greenville Spartanburg Airport February 6, 2017 in Greenville, South Carolina. Zinouri, a Clemson graduate, works for a technology firm in Greenville, South Carolina and has lived in the United States for the last seven years. While attempting to return to South Carolina after a recent trip visiting family in Iran, she had been taken off her flight in Dubai as a result of the recent travel and immigration ban ordered by President Donald Trump. (Sean Rayford/Getty Images) Banah Alhanfy is greeted by her uncle (R) at Logan Airport after she cleared U.S. customs and immigration on special immigrant visa in Boston, Massachusetts, U.S. February 3, 2017. Alhanfy's father was an interpreter for the United States in Iraq and she arrived in the U.S. following U.S. President Donald Trump's executive order travel ban. REUTERS/Brian Snyder (Brian Snyder/Reuters) Opponents of U.S. President Donald Trump's executive order travel ban greet international travelers at Logan Airport in Boston, Massachusetts, U.S. February 3, 2017. REUTERS/Brian Snyder (Brian Snyder/Reuters) In this framegrab from video released by the United States Courts, US District Judge James Robart, on February 3, 2017 in Seattle, rules on the travel ban imposed by US President Donald Trump. Robart, an appointee of former US President George W. Bush, issued a temporary stay on Trump's immigration orders. / AFP PHOTO / UNITED STATES COURTS / Jose ROMERO / RESTRICTED TO EDITORIAL USE - MANDATORY CREDIT "AFP PHOTO / UNITED STATES COURTS" - NO MARKETING NO ADVERTISING CAMPAIGNS - DISTRIBUTED AS A SERVICE TO CLIENTS JOSE ROMERO/AFP/Getty Images (Jose Romero/AFP/Getty Images) Washington Attorney General Bob Ferguson, center, talks to reporters as Solicitor General Noah Purcell, second from right, looks on, Friday, Feb. 3, 2017, following a hearing in federal court in Seattle. A U.S. judge on Friday temporarily blocked President Donald Trump's ban on people from seven predominantly Muslim countries from entering the United States after Washington state and Minnesota urged a nationwide hold on the executive order that has launched legal battles across the country. (AP Photo/Ted S. Warren) An opponent of U.S. President Donald Trump's executive order travel ban hands flowers to a member of a Lufthansa flight crew at Logan Airport in Boston, Massachusetts, U.S. February 3, 2017. The Lufthansa flight carried several Boston area college students who had previously been denied travel under the travel ban. REUTERS/Brian Snyder (Brian Snyder/Reuters) Behnam Partopour, a Worcester Polytechnic Institute (WPI) student from Iran, is greeted by his sister Bahar (L) at Logan Airport after he cleared U.S. customs and immigration on an F1 student visa in Boston, Massachusetts, U.S. February 3, 2017. Partopour was originally turned away from a flight to the U.S. following U.S. President Donald Trump's executive order travel ban. REUTERS/Brian Snyder TPX IMAGES OF THE DAY (Brian Snyder/Reuters) Opponents of U.S. President Donald Trump's executive order travel ban greet members of a Lufthansa flight crew at Logan Airport in Boston, Massachusetts, U.S. February 3, 2017. The Lufthansa flight carried several Boston area college students who had previously been denied travel under the travel ban. REUTERS/Brian Snyder (Brian Snyder/Reuters) Niki Rahmati, a student at the Massachusetts Institute of Technology (MIT) from Iran, is greeted by immigration attorney Susan Church (R) at Logan Airport after she cleared U.S. customs and immigration on an F1 student visa in Boston, Massachusetts, U.S. February 3, 2017. Rahmati was originally turned away from a flight to the U.S. following U.S. President Donald Trump's executive order travel ban. REUTERS/Brian Snyder (Brian Snyder/Reuters) Samira Asgari is greeted U.S. Congressman Joe Kennedy at Logan Airport after she cleared U.S. customs and immigration in Boston, Massachusetts, U.S. February 3, 2017. Asgari is an Iranian scientist who had obtained a visa to conduct research at Brigham and Women's Hospital and was twice prevented from entering the United States under President Trump's executive order travel ban. REUTERS/Brian Snyder (Brian Snyder/Reuters) Munther Alaskry, accompanied by his son Hassan, and daughter Dima arrive at New York's JFK International Airport, in New York, Friday, Feb. 3, 2017. Alaskry and his family arrived at New York's Kennedy Airport after the Trump administration reversed course and said he and other interpreters who supported the U.S. military could come to America. They spent nearly a week in limbo in Baghdad, thinking their hopes of starting a new life free from death threats had been shattered. (AP Photo/Richard Drew) Hassan Alaskry, the son of Munther Alaskry, surveys the arrival area as his sister Dima, and mother Hiba Alaskry arrive at New York's JFK International Airport, in New York, Friday, Feb. 3, 2017. Munther Alaskry and his family arrived at New York's Kennedy Airport after the Trump administration reversed course and said he and other interpreters who supported the U.S. military could come to America. They spent nearly a week in limbo in Baghdad, thinking their hopes of starting a new life free from death threats had been shattered. (AP Photo/Richard Drew) Munther Alaskry, right, is interviewed by members of the lawyers group NoBanJFK as he arrives at New York's JFK International Airport, in New York, Friday, Feb. 3, 2017. Alaskry and his family arrived at New York's Kennedy Airport after the Trump administration reversed course and said he and other interpreters who supported the U.S. military could come to America. They spent nearly a week in limbo in Baghdad, thinking their hopes of starting a new life free from death threats had been shattered. (AP Photo/Richard Drew) Dima Alaskry, 7, daughter of Munther Alaskry, shows the "Welcome to New York" greeting she received, as her father, Munther Alaskry, loaded luggage in a car at New York's JFK International Airport, in New York, Friday, Feb. 3, 2017. Alaskry and his family arrived at New York's Kennedy Airport after the Trump administration reversed course and said he and other interpreters who supported the U.S. military could come to America. They spent nearly a week in limbo in Baghdad, thinking their hopes of starting a new life free from death threats had been shattered. (AP Photo/Richard Drew) Hiba Alaskry, wife of Munther Alaskry, talks with their daughter Dima as their son Hassan naps on a couch in the lobby of their New York hotel, Friday, Feb. 3, 2017. Munther Alaskry and his family arrived at New York's Kennedy Airport after the Trump administration reversed course and said he and other interpreters who supported the U.S. military could come to America. They spent nearly a week in limbo in Baghdad, thinking their hopes of starting a new life free from death threats had been shattered. (AP Photo/Richard Drew) A Chicago area immigration attorney offers her assistance to arriving passengers at O'Hare airport in Chicago, Illinois, U.S. February 4, 2017. Her placard reads in Arabic, "Welcome travellers. We appreciate if you could talk to us about your trip and your experience with customs so that we can assist immigrants in the future. This group has lawyers who speak Arabic". REUTERS/Kamil Krzaczynski (Kamil Krzaczynski/Reuters) Ammar Alnajjar, left, shakes hands with his cousin, Fahd Alfakih, after coming into New York's JFK International Airport on a flight from Istanbul, Turkey, Saturday, Feb. 4, 2017. The government on Saturday suspended enforcement of President Donald Trump's refugee and immigration ban, enabling Alnajjar to return from Turkey where he was visiting his wife. (AP Photo/William Mathis) epa05773298 Demonstrators show their support for arriving passengers at the international arrival area at Dulles International Airport in Sterling, Virginia, USA, 05 February 2017. A federal judge on 03 February issued a temporary restraining order blocking enforcement of US President Trump's executive order from 27 January that banned people from seven mainly Muslim countries from entering the United States. EPA/Astrid Riecken (Astrid Riecken/EPA) epa05773299 Roslyn Sinha (R), 30, hugs her immigration attorney Elinor K. Tesfanariam, who has been volunteering and offering legal help at Dulles International Airport in Sterling, Virginia, USA, 05 February 2017. Sinha is Iraqi citizen married to a US citizen and has lived with her husband in Texas for the last six months and is in the process of applying for her green card. The day US President Trump ordered the travel ban, Sinha was flying to Dubai to visit her mother who is in the hospital after suffering from a stroke and was not able to return to the US. A federal judge on 03 February issued a temporary restraining order blocking enforcement of US President Trump's executive order from 27 January that banned people from seven mainly Muslim countries from entering the United States. EPA/Astrid Riecken (Astrid Riecken/EPA) epa05773296 Roslyn Sinha, 30, speaks about her travel experience to reporters at Dulles International Airport in Sterling, Virginia, USA, 05 February 2017. Sinha is Iraqi citizen married to a US citizen and has lived with her husband in Texas for the last six months and is in the process of applying for her green card. The day US President Trump ordered the travel ban, Sinha was flying to Dubai to visit her mother who is in the hospital after suffering from a stroke and was not able to return to the US. A federal judge on 03 February issued a temporary restraining order blocking enforcement of US President Trump's executive order from 27 January that banned people from seven mainly Muslim countries from entering the United States. EPA/Astrid Riecken (Astrid Riecken/EPA) Photo Gallery: After a federal judge in Seattle temporarily blocked enforcement of President Trump’s travel ban, government authorities immediately told airlines to allow travel by those who had been barred, a U.S. official said.

Since then, the travel ban has evolved as Trump's administration has attempted to clarify exceptions to the order. The Department of Homeland Security said the ban would not apply to permanent residents or green-card holders, dual citizens who carry a passport from somewhere other than one of the banned countries and those with NATO or U.N. visas.

Robart's ruling Friday, which was broader than similar ones before it, sets up a high-stakes legal confrontation between the new president and the judicial branch.

The ruling is temporary, and the ultimate question of whether Trump’s executive order will pass constitutional muster will fall to higher-level courts. Legal analysts have said the ban could be difficult to permanently undo because the president has broad authority to set immigration policy.

Later Saturday morning, the State Department announced it would reverse its visa revocations, allowing previously banned travelers to enter the United States.

Trump, presumably responding to the latest development, resumed tweeting his displeasure hours later.

And then again, an hour later:

Though his tweet implied that “anyone” could now come into the United States, the State Department's announcement applied to travelers from those countries who already held valid visas.

“Those individuals with visas that were not physically canceled may now travel if the visa is otherwise valid,” a State Department spokesman said Saturday, adding that Department of Homeland Security personnel “will resume inspection of travelers in accordance with standard policy and procedure.”

Matt Zapotosky, Lori Aratani and Justin Jouvenal contributed to this article. This post has been updated.