She also took on the leaders of an Atlanta suburb who refused to allow construction of a mosque. The Justice Department sued, and the city reversed itself. “Religious freedom requires that local government decisions impacting the exercise of that freedom be free of discrimination,” Ms. Yates said at the time.

When Ms. Yates, who declined to comment on Tuesday, became deputy attorney general in 2015, she told colleagues that she had no intention of merely being a caretaker. “We’re going to run through the tape,” she often said.

In Washington, her outgoing personality made her a counterpoint to her more reserved boss, Attorney General Loretta E. Lynch. At times that made Ms. Yates the face of the Justice Department in ways that caused tension with Ms. Lynch’s staff. Ms. Yates was regarded as professionally ambitious, though she has told friends that she has no interest in running for political office.

Last year, Ms. Yates and Ms. Lynch earned the ire of Democrats — including many in the department — for not intervening to prohibit the F.B.I. director, James B. Comey, from sending a letter to Congress in the final days of the presidential campaign. The letter raised the prospect of new and potentially damaging evidence against Hillary Clinton related to an investigation that had been closed. Nothing came of the new evidence, and Mrs. Clinton’s team says the letter cost her the presidency. Her supporters argued that Justice Department leaders were too timid to stand up to Mr. Comey.

Mr. Trump’s executive order prompted a new challenge for Ms. Yates, who was serving until the Senate confirmed a new attorney general. The Justice Department’s Office of Legal Counsel had reviewed and signed off on the order, but Ms. Yates believed that the department had to also consider the president’s intent, which she said appeared aimed at singling out people based on religion.

Mr. Trump had promised to do as much. His campaign website still calls for a “total and complete shutdown of Muslims entering the United States until our country’s representatives can figure out what is going on.” After the decision was announced, one of his advisers, Rudolph W. Giuliani, the former mayor of New York, said in an interview that Mr. Trump had wanted a Muslim ban but needed “the right way to do it legally.” Mr. Trump then said in an interview with the Christian Broadcasting Network that Christian refugees would be given priority for entry visas to the United States.