WASHINGTON — Rachel L. Brand, the No. 3 official at the Justice Department, plans to step down after nine months on the job as the country’s top law enforcement agency has been under attack by President Trump, according to two people briefed on her decision.

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, will become the global governance director at Walmart, the company’s top legal position, according to people briefed on her move. She has held politically appointed positions in the past three presidential administrations.