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.