Mr. Barr’s record of politicizing the Justice Department, however, has been complicated by his approach to the election. He publicly rejected Mr. Trump’s spurious claims of election fraud and kept the department out of the dozens of failed lawsuits the Trump campaign and allies have brought seeking to subvert the outcome.

It has also emerged that Mr. Barr knew that President-elect Joseph R. Biden Jr.’s son Hunter Biden was the subject of a money laundering investigation that appears to have subsided and a tax investigation, but he respected department norms and did not make that information public before the election despite open demands from Mr. Trump to damage Mr. Biden. And since the disclosure of those inquiries, Mr. Barr resisted Mr. Trump’s pressure to appoint a special counsel for the Hunter Biden inquiry.

Mr. Barr’s resistance to Mr. Trump’s demands that he use the department to subvert the election strained their previously close relationship, leading Mr. Trump to bully Mr. Barr on Twitter over the weekend and culminating with Mr. Barr’s submission of a resignation letter on Monday. It will now fall to Mr. Rosen to decide whether to maintain Mr. Barr’s stances on such issues during what may be a fraught endgame for Mr. Trump.

It will be an intense change of pace for a lawyer mainly versed in business and administrative law issues, although he has sometimes strayed into the murkier waters of the Trump era.

In late summer 2019, not long after his intervention that helped Mr. Manafort stay out of Rikers Island, Mr. Rosen convened a meeting with lawyers for the former F.B.I. deputy director Andrew G. McCabe regarding accusations that he had lied to internal investigators about dealings with the news media.

Asking a grand jury to indict Mr. McCabe would be in line with the desires of Mr. Trump, who had repeatedly attacked him; he was the acting director of the F.B.I. when investigators opened an inquiry into whether the president obstructed justice. But Mr. McCabe’s lawyers urged Mr. Rosen to shelve the case, arguing that their client had not intentionally lied and noting that in any case, false statements made during internal inquiries at federal law enforcement agencies are typically punished administratively, not by criminal prosecution.

Mr. Rosen rejected their appeal, which would normally be a precursor to an indictment. (In a twist, the grand jury did not indict Mr. McCabe. It remains unclear whether prosecutors asked for an indictment and the jury balked, or whether prosecutors — seeing the reaction of the jurors to the evidence and arguments — pulled the case back.)