Ms. Brand’s profile had risen in part because she is next in the line of succession behind the deputy attorney general, Rod J. Rosenstein, who is overseeing the special counsel’s inquiry into Russian influence in the 2016 election. Mr. Trump, who has called the investigation a witch hunt, has considered firing Mr. Rosenstein.

Such a move could have put her in charge of the special counsel and, by extension, left her in the cross hairs of the president.

Ms. Brand, who became the associate attorney general in May 2017, is leaving for a job as general counsel in the private sector. She has held politically appointed positions at the Justice Department over the past three presidential administrations.