A U.S. judge on Friday temporarily blocked President Donald Trump's ban on travelers and immigrants from seven predominantly Muslim countries after Washington state and Minnesota urged a nationwide hold on the executive order that has launched legal battles across the country.

U.S. District Judge James Robart in Seattle ruled that the states had standing to challenge Trump's order, which government lawyers disputed, and said they showed their case was likely to succeed.

"The state has met its burden in demonstrating immediate and irreparable injury," Robart said.

Immigration Law Center of Minnesota executive director John Keller said he's encouraged by the order.

"The judiciary will intercede even if the person they are interceding against is the president of the United States," Keller said, adding that it's not clear how quickly officials will respond to let people previously denied to now enter.

Trump's order last week sparked protests nationwide and confusion at airports as some travelers 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.

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 says key sections of Trump's order are illegal and unconstitutional. 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.

'Baba, when are you coming?': For immigrant families in limbo, the waiting becomes indefinite

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.

— MPR News reporter Laura Yuen contributed to this story.