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.

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.

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.