The Justice Department’s third-ranking official, Rachel Brand, resigned Friday to take a senior job at Walmart Inc., adding to the turmoil at an agency facing multiple vacancies and criticism from various sources, including the White House.

Ms. Brand will be a Walmart executive vice president and corporate secretary, the company said Friday. Her exit caught senior Justice Department officials by surprise, and after news of the departure was reported, the department issued a statement confirming it. Attorney General Jeff Sessions praised Ms. Brand, saying she had “played a critical role in helping us accomplish our goals as a Department.”

Ms. Brand, in the same release, said she was proud of her time at the agency.

Ms. Brand’s portfolio was broad, focusing on civil matters rather than criminal or national security issues. She had taken the lead on several initiatives championed by Mr. Sessions, including revoking guidance documents issued by previous administrations on an array of subjects. She also oversaw efforts to combat human trafficking, hosting a daylong summit on the topic last week.

President Donald Trump nominated Ms. Brand early last year; she was confirmed by the Senate to be associate attorney general in May. Serving such a senior department role for less than a year is unusual.