Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

President Donald Trump fired Acting Attorney General Sally Yates on Monday night after she directed Justice Department lawyers not to defend his executive order on immigration.

The Trump administration said it had "relieved" Yates — who was deputy attorney general in the administration of President Barack Obama and stayed on as acting attorney general pending the confirmation of Sen. Jeff Sessions, R-Alabama — and named Dana Boente, 63, the U.S. attorney for the Eastern District of Virginia, to serve in the meantime.

The Justice Department said shortly after midnight ET that Boente had rescinded Yates' directive.

Boente was sworn in at 9 p.m. ET, said Michael Short, a senior assistant White House press secretary — a swift reaction to Yates' memo to Justice Department lawyers earlier in the day, ordering them not to go to court to defend sharp restrictions Trump ordered last week on immigration from seven majority Muslim countries.

Yates "has betrayed the Department of Justice by refusing to enforce a legal order designed to protect the citizens of the United States," the White House said in a statement, adding: "Ms. Yates is an Obama Administration appointee who is weak on borders and very weak on illegal immigration."

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Shortly afterward, the Department of Homeland Security confirmed that Daniel Ragsdale, the acting head of U.S. Immigration and Customs Enforcement, had also been replaced. Unlike the firing of Yates, the replacement of Ragsdale, who'd been ICE's deputy director under Obama, came with no explanation.

The Justice Department's Office of Legal Counsel signed off on Trump's order last week, but Yates said the office's reviews don't "address whether any policy choice embodied in an Executive Order is wise or just."

Sally Yates in June 2016. J. David Ake / AP

"At present, I am not convinced that the defense of the Executive Order is consistent with [the Justice Department's] responsibilities nor am I convinced that the Executive Order is lawful," she wrote. "For as long as I am the acting attorney general, the Department of Justice will not present arguments in defense of the executive order, unless and until I become convinced that it is appropriate to do so."

The memo came to light only a few hours after Obama broke his post-presidential silence in a statement backing protesters demonstrating against the executive order.

Obama "fundamentally disagrees with the notion of discriminating against individuals because of their faith or religion," the statement said.

Related: Obama Rejects Trump Immigration Orders, Backs Protests

Lee Gelernt, deputy director of the Immigrants' Rights Project of the American Civil Liberties Union, called Yates' firing "very troubling" but said, "We will move forward.

"After her principled stand, it will now be impossible for the White House to continue stating that our lawsuits have no merit," Gelernt said.

Senate Minority Leader Chuck Schumer, D-New York, said in a statement: "The Attorney General should be loyal and pledge fidelity to the law, not the White House. The fact that this administration doesn't understand that is chilling."

But Stephen Miller, a senior policy adviser to Trump and a major architect of the travel ban, said, "It's sad ... that you have people refusing to enforce our laws."

In an interview Monday night on MSNBC's "For the Record," Miller said it was "sadder still that you have a situation where the previous administration — and I don't want to bring up the past — lifted, removed, eliminated whole sections of immigration law, and it wasn't even considered by many in the media and many in the administration to be matter of controversy."

Yates' memo would appear to represent the most serious rebellion by the Justice Department since the "Saturday Night Massacre" of October 1973, when Attorney General Elliot Richardson and Deputy Attorney General William Ruckelshaus resigned rather than carry out President Richard Nixon's order to fire Archibald Cox, the Watergate special prosecutor.

Three years earlier, Nixon fired Interior Secretary Wally Hickel for opposing his Vietnam War policies.

Boente — pronounced BENT-uh — was appointed U.S. attorney in New Orleans in 2012 and became acting U.S. attorney in Alexandria, Virginia, the following year. Obama appointed him to the job full-time in 2015.