WASHINGTON — President Trump fired his acting attorney general on Monday night, removing her as the nation’s top law enforcement officer after she defiantly refused to defend his executive order closing the nation’s borders to refugees and people from predominantly Muslim countries.

In an escalating crisis for his 10-day-old administration, the president declared in a statement that Sally Q. Yates, who had served as deputy attorney general under President Barack Obama, had betrayed the administration by announcing that Justice Department lawyers would not defend Mr. Trump’s order against legal challenges.

The president replaced Ms. Yates with Dana J. Boente, the United States attorney for the Eastern District of Virginia, saying that he would serve as attorney general until Congress acts to confirm Senator Jeff Sessions of Alabama. In his first act in his new role, Mr. Boente announced that he was rescinding Ms. Yates’s order.

Monday’s events have transformed the confirmation of Mr. Sessions into a referendum on Mr. Trump’s immigration order. Action in the Senate could come as early as Tuesday.

Ms. Yates’s order was a remarkable rebuke by a government official to a sitting president, and it recalled the so-called Saturday Night Massacre in 1973, when President Richard M. Nixon fired his attorney general and deputy attorney general for refusing to dismiss the special prosecutor in the Watergate case.

Photo

Dana J. Boente, United States attorney for the Eastern District of Virginia, in 2012.Credit
Evan Vucci/Associated Press

Mr. Boente was sworn in at 9 p.m., according to White House officials, who did not provide details about who performed the ceremony. In a statement, Mr. Boente pledged to “defend and enforce the laws of our country.”

At 9:15 p.m., Ms. Yates received a hand-delivered letter at the Justice Department that informed her that she was fired. Signed by John DeStefano, one of Mr. Trump’s White House aides, the letter informed Ms. Yates that “the president has removed you from the office of Deputy Attorney General of the United States.”

Two minutes later, the White House officials lashed out at Ms. Yates in a statement issued by Sean Spicer, the White House press secretary.

“Ms. Yates is an Obama administration appointee who is weak on borders and very weak on illegal immigration,” the statement said.

The firing of Ms. Yates came at the end of a turbulent three days that began on Friday with Mr. Trump’s signing of his executive order. The action stranded travelers around the world, led to protests around the country and created alarm inside the bureaucracy.

Photo

Sean Spicer, the White House press secretary, defended Mr. Trump’s visa ban during a briefing on Monday.Credit
Stephen Crowley/The New York Times

Ms. Yates, like other senior government officials, was caught by surprise by the executive order and agonized over the weekend about how to respond, two Justice Department officials involved in the weekend deliberations said. Ms. Yates considered resigning but she told colleagues she did not want to leave it to her successor to face the same dilemma.

By Monday afternoon, Ms. Yates added to a deepening sense of anxiety in the nation’s capital by publicly confronting the president with a stinging challenge to his authority, laying bare a deep divide at the Justice Department, within the diplomatic corps and elsewhere in the government over the wisdom of his order.

“At present, I am not convinced that the defense of the executive order is consistent with these responsibilities, nor am I convinced that the executive order is lawful,” Ms. Yates wrote in a letter to Justice Department lawyers.

Mr. Trump’s senior aides huddled together in the West Wing to determine what to do.

They decided quickly that her insubordination could not stand, according to an administration official familiar with the deliberations. Among the chief concerns was whether Mr. Sessions could be confirmed quickly by the Senate.

After Reince Priebus, the White House chief of staff, received reassurances from Senator Mitch McConnell of Kentucky, the Republican leader, that the confirmation was on track, aides took their recommendation to Mr. Trump in the White House residence.

You are already subscribed to this email.

The official statement from Mr. Spicer accused Ms. Yates of failing to fulfill her duty to defend a “legal order designed to protect the citizens of the United States” that had been approved by the Justice Department’s Office of Legal Counsel.

“It is time to get serious about protecting our country,” Mr. Spicer said in the statement. He accused Democrats of holding up the confirmation of Mr. Sessions for political reasons. “Calling for tougher vetting for individuals traveling from seven dangerous places is not extreme. It is reasonable and necessary to protect our country.”

Former Justice Department officials said the president’s action would send a deep shudder through an agency that was already on edge as officials anticipated an ideological overhaul once Mr. Sessions takes over. One former senior official said that department lawyers would be unnerved by the firing.

Video

Reaction to Yates’s Firing

Richard Blumenthal, Democratic senator from Connecticut, said he saluted Sally Q. Yates’s legal principle and questioned whether the next attorney general would uphold the rule of law.

By THE NEW YORK TIMES on Publish Date January 31, 2017.
Photo by Zach Gibson/The New York Times.
Watch in Times Video »

Democrats, meanwhile, hailed Ms. Yates as a principled defender of what she thought was right. Senator Chuck Schumer of New York, the Democratic leader, said in a statement that 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.”

Mr. Boente has told the White House that he is willing to sign off on Mr. Trump’s executive order on refugees and immigration, according to Joshua Stueve, a spokesman for the United States attorney’s office in Alexandria, Va., where Mr. Boente has served as the top prosecutor since 2015.

Mr. Boente, who has been a prosecutor with the Justice Department for 31 years, had no hesitation about accepting the acting attorney general’s job given his “seniority and loyalty” to the department, Mr. Stueve said in a telephone interview on Monday night.

As acting attorney general, Ms. Yates was the only person at the Justice Department authorized to sign applications for foreign surveillance warrants. Administrations of both parties have interpreted surveillance laws as requiring foreign surveillance warrants be signed only by Senate-confirmed Justice Department officials. Mr. Boente was Senate-confirmed as United States attorney and, though the situation is unprecedented, the White House said he was authorized to sign the warrants.

Ms. Yates’s decision had effectively overruled a finding by the Justice Department’s Office of Legal Counsel, which had already approved the executive order “with respect to form and legality.”

Ms. Yates said her determination in deciding not to defend the order was broader, however, and included questions not only about the order’s lawfulness, but also whether it was a “wise or just” policy. She also alluded to unspecified statements the White House had made before signing the order, which she factored into her review.

Mr. Trump initially responded to the letter with a post on Twitter at 7:45 p.m., complaining that the Senate’s delay in confirming his cabinet nominees had resulted in leaving Ms. Yates in place.

The Democrats are delaying my cabinet picks for purely political reasons. They have nothing going but to obstruct. Now have an Obama A.G.

The 1973 “Saturday Night Massacre” led to a constitutional crisis that ended when Robert H. Bork, the solicitor general, acceded to Mr. Nixon’s order and fired Archibald Cox, the special prosecutor.

Ms. Yates, a career prosecutor, is different because she is a holdover from the Obama administration. She agreed to Mr. Trump’s request to stay on as acting attorney general until Mr. Sessions is confirmed to be attorney general.