Washington State Attorney General Bob Ferguson said this week that the travel ban significantly harms residents and effectively mandates discrimination. Minnesota joined the suit two days later.
After the ruling, Ferguson said people from the affected countries can now apply for entry to the U.S.
"Judge Robart's decision, effective immediately ... puts a halt to President Trump's unconstitutional and unlawful executive order," Ferguson said. "The law is a powerful thing —-- it has the ability to hold everybody accountable to it, and that includes the president of the United States."
Gillian M. Christensen, a spokeswoman for the Department of Homeland Security, said the agency doesn't comment on pending litigation.
Federal attorneys had argued that Congress gave the president authority to make decisions on national security and immigrant entry.
The two states won a temporary restraining order while the court considers the lawsuit, which aims to permanently block Trump's order. Court challenges have been filed nationwide from states and advocacy groups.
Up to 60,000 foreigners from the seven majority-Muslim countries had their visas canceled because of the executive order, the State Department said Friday.
That figure contradicts a statement from a Justice Department lawyer on the same day during a court hearing in Virginia about the ban. The lawyer in that case said about 100,000 visas had been revoked.
The State Department clarified that the higher figure includes diplomatic and other visas that were actually exempted from the travel ban, as well as expired visas.
Washington and Minnesota's lawsuit says Trump campaigned on a promise to ban Muslims from coming to the U.S. and kept up that rhetoric while defending the travel ban. Lawyers pointed to dozens of speeches and statements 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 says.
Ferguson said the order is harming 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's hurting their operations, too.
Lawyers for Washington state said another hearing was expected in the next few weeks.
Associated Press reporter Alicia A. Caldwell contributed from Washington.