Donald Trump has hit back after a judge temporarily blocked his travel ban on people from seven predominantly Muslim countries.
US District Judge James Robart in Seattle acted after Washington state and Minnesota urged a nationwide hold on the executive order that has launched legal battles across the country.
He ruled against government lawyers' claims that the states did not have the standing to challenge Mr Trump's order and said they showed their case was likely to succeed.
About 60,000 people from the affected countries had their visas cancelled.
"The state has met its burden in demonstrating immediate and irreparable injury," the judge said.
"This TRO (temporary restraining order) is granted on a nationwide basis."
It was not immediately clear what happens next for people who had waited years to receive visas to go to America.
However an internal email circulated among Homeland Security officials told employees to comply with the ruling immediately.
White House spokesman Sean Spicer released a statement saying they "will file an emergency stay of this outrageous order and defend the executive order of the president, which we believe is lawful and appropriate".
Soon after, the White House sent out a new statement that removed the word "outrageous".
Mr Spicer said: "The president's order is intended to protect the homeland and he has the constitutional authority and responsibility to protect the American people."
Mr Trump's order last week sparked protests nationwide and confusion at airports as some travellers were detained. The White House has argued that it will make the country safer.
Washington became the first state to sue, with Attorney General Bob Ferguson saying the order was causing significant harm to residents and effectively mandates discrimination. Minnesota joined the suit this week.
The two states won a temporary restraining order while the court considers the lawsuit, which says key sections of Mr Trump's order are illegal and unconstitutional.
Court challenges have been filed nationwide from states and advocacy groups, with some other hearings also held Friday.
"Washington has a profound interest in protecting its residents from the harms caused by the irrational discrimination embodied in the order," Mr Ferguson said.
Federal lawyers had argued that Congress gave the president authority to make decisions on national security and admitting immigrants.
The lawsuit says Mr Trump campaigned on a promise to ban Muslims from coming to the US and kept up that rhetoric while defending the travel ban.
Lawyers pointed to dozens of exhibits of speeches and statements that Mr Trump has made.
"The executive order effectively mandates that the states engage in discrimination based on national origin and/or religion, thereby rescinding the states' historic protection of civil rights and religious freedom," the complaint said.
It called it a violation of the US constitution.
The lawsuit ultimately seeks to permanently block parts of the executive order that suspend immigration from the seven Muslim-majority countries, put the US refugee admissions programme on hold and halt entry of Syrian refugees.
Mr Ferguson said the order is causing significant harm to Washington residents, businesses and its education system.
It will reduce tax revenue and impose significant costs on state agencies, as well as make it impossible for some state employees and students to travel, he said.
Washington-based businesses Amazon, Expedia and Microsoft support the state's efforts to stop the order. They say it is hurting their operations, too.