WASHINGTON — President Donald Trump fired the federal government’s top lawyer, acting Attorney General Sally Yates, on Monday after she took the extraordinarily rare step of defying the White House and refused to defend new travel restrictions targeting seven Muslim-majority nations.

Yates said late Monday that the Justice Department would not defend in court Trump’s directive that put a 120-day hold on allowing refugees into the country, an indefinite ban on refugees from Syria and a 90-day bar on citizens from Iran, Iraq, Libya, Somalia, Sudan, Syria and Yemen.

Yates said she did not believe defending the order would be “consistent with this institution’s solemn obligation to always seek justice and stand for what is right.”

Hours later, she was fired. The White House said Yates “has betrayed the Department of Justice by refusing to enforce a legal order designed to protect the citizens of the United States” and portrayed her actions as political.

Trump has argued tougher vetting of immigrants is needed to protect America from terror attacks but critics complain that his order unfairly singles out Muslims and defiles America’s historic reputation as a welcoming place for immigrants.

Yates, an appointee of former Democratic President Barack Obama, was days away from being replaced by Trump’s pick for the top spot at the Justice Department, Republican U.S. Sen. Jeff Sessions, who is awaiting Senate confirmation.

“Ms. Yates is an Obama Administration appointee who is weak on borders and very weak on illegal immigration,” the White House said in a statement.

The White House said that Dana Boente, U.S. attorney for the Eastern District of Virginia, would be acting U.S. attorney general until Sessions is approved.

Boente said in an interview with The Washington Post that he would enforce the immigration order.

Trump’s action came as backlash built on Monday against his executive order imposing the travel and immigration restrictions as opponents tried to throw up roadblocks, including more court challenges.

The state of Washington, meanwhile, announced it would sue, saying Trump’s order violated the U.S. Constitution, and Democrats in Congress pushed a vote to try to rescind the bill, but were blocked.

Trump has argued tougher vetting of immigrants is needed to protect America from terror attacks but critics complain that his order unfairly singles out Muslims and defiles America’s historic reputation as a welcoming place for immigrants.

An internal Department of Homeland Security document seen by Reuters showed 348 visa holders were kept from boarding U.S.-bound flights this week, and more than 200 people came to the United States but were denied entry.

More than 735 people were pulled aside for questioning by U.S. Customs and Border Protection officers in airports, including 394 green card holders, who are legal permanent residents of the United States, the document said.

Trump’s order was developed hastily and was not extensively reviewed by the agencies which are now grappling with implementing it. Trump’s administration is granting waivers from the refugee ban to allow 872 people into the country this week — refugees that had already been cleared for resettlement in the United States and were in transit when the order came out.

Chaos broke out over the weekend as border and customs officials struggled to put the order into practice amid loud protests at major U.S. airports. Federal judges blocked deportation of those detained under the order.

U.S. stocks suffered their biggest drop of 2017 as investors took the curb on immigration as a reminder that not all the new president’s policies would be market-friendly.

Washington state will be the first to take on the executive order, announcing an effort to sue in federal court.

“It is an insult and a danger to all of the people of the state of Washington, of all faiths,” Gov. Jay Inslee, a Democrat, told reporters. He said it was important for the Trump administration to face lawsuits from the state itself, and not just cases filed by people who have been impacted by the order.

Washington state Attorney General Bob Ferguson said the lawsuit would include constitutional claims, including allegations that Trump’s order violates the equal protection clause and the First Amendment. Those arguments are also being used in other lawsuits filed over the weekend on behalf of individuals detained at U.S. airports.

Technology companies Amazon.com In. and Expedia Inc., both of which are based in Washington’s Seattle area, will support the state’s suit, Ferguson said.

Another Washington state company, Microsoft Corp., said it has been cooperating with the attorney general’s office to provide information about the order’s impact “in order to be supportive.”

Several other state attorneys general, including those from California and New York, have said they are considering whether to take their own legal action. The Council on American-Islamic Relations, the country’s biggest Muslim advocacy group, filed a federal lawsuit on behalf of more than 20 people.

Democratic lawmakers introduced legislation on Monday seeking to block Trump’s order, but the measures were unlikely to advance without support from Trump’s fellow Republicans, who control majorities in both houses of Congress and have largely expressed support for his actions.

Democrats in the Senate tried to force a vote on a bill to rescind the order, but were blocked by a Republican lawmaker. Even if a bill advanced, it would be unlikely that Trump would sign it.

Obama took the rare step of weighing in, saying through a spokesman that he was heartened by the political activism on the issue.

But White House spokesman Sean Spicer argued Trump’s move was popular with Americans who are worried about attacks.

On Twitter, Trump appeared to blame the airport confusion on protesters as well as on U.S. Sen. Chuck Schumer, who teared up over the weekend while discussing the ban, and even a computer system failure at Delta Air Lines Inc. late on Sunday.

“Only 109 people out of 325,000 were detained and held for questioning. Big problems at airports were caused by Delta computer outage … protesters and the tears of Senator Schumer. Secretary Kelly said that all is going well with very few problems. MAKE AMERICA SAFE AGAIN!” Trump tweeted, referring to Homeland Security Secretary John Kelly.

There was criticism from within the government. State Department officials circulated a draft memo of dissent, saying Trump’s move would hurt America’s image abroad and inflame anti-American sentiment.

Separately, U.S. officials said the department received multiple cables from U.S. embassies over the weekend reporting foreign dissatisfaction at the order.

The Iraqi parliament voted to ask the country’s government to retaliate against the United States, putting at risk cooperation in the fight against Islamic State.

A government official in Baghdad said Foreign Minister Ibrahim al-Jaafari plans to meet the U.S. ambassador soon to express dismay at Trump’s decision.

British Foreign Secretary Boris Johnson joined a chorus of concern expressed by U.S. allies, ranging from Iraq to Germany.

“This is, of course, a highly controversial policy, which has caused unease and, I repeat, this is not an approach that this government would take,” Johnson told Parliament.

Tens of thousands of protesters gathered in London and other British cities Monday to demonstrate against the ban. People, some holding placards reading “No to Racism, No to Trump” and “Dump Trump” staged a protest outside the prime minister’s Downing Street residence.