Deputy Attorney General Rod Rosenstein has submitted his resignation, ending a two-year run defined by his appointment of a special counsel to investigate connections between Donald Trump's presidential campaign and Russia.
His last day will be 11 May.
Mr Rosenstein's departure had been expected following the confirmation of William Barr as attorney general. The White House nominated a replacement for the department's number two slot weeks ago.
In his resignation letter to Donald Trump, Mr Rosenstein paid tribute to Mr Trump, even praising the president's sense of humor, despite being the subject of some of Trump's most biting jabs. Mr Trump once retweeted an image that showed Mr Rosenstein and other officials jailed for treason.
Mr Rosenstein intended to leave around mid-March but stayed on for the completion of special counsel Robert Mueller's Russia investigation.
Mr Mueller last month submitted his report to the Justice Department, and Mr Rosenstein was part of a small group of department officials who reviewed the document and helped shape its public release. After Mr Mueller didn't reach a conclusion on whether Mr Trump had obstructed the investigation, Mr Barr and Mr Rosenstein stepped in and determined the evidence wasn't enough to support such an allegation.
Mr Rosenstein appointed Robert Mueller in May 2017 following the recusal of then-Attorney General Jeff Sessions and oversaw much of his work.
His exit leaves the department without the official most closely aligned with the probe as officials grapple with public and congressional scrutiny of the special counsel's findings and the department's handling of the report.
He not only supervised Mr Mueller's work for much of the last two years but also defended the investigation against attacks from congressional Republicans and Donald Trump, who has blasted the probe as a "witch hunt." In so doing, Mr Rosenstein sometimes found himself at odds with Mr Trump. He was nonetheless spared the brunt of anger directed at Mr Sessions, whose recusal from the Russia investigation infuriated the president, leading to his forced resignation last November.
As deputy, Mr Rosenstein was a central character in some of the most consequential, even chaotic, moments of the Trump administration. He wrote a memo criticizing James Comey that the White House used as justification for the firing of the FBI director, then a week later appointed Mr Mueller to investigate the Trump campaign's ties to Russia. That investigation swiftly grew to include whether the firing of Mr Comey constituted obstruction of justice.
Integral to the start of the investigation, Mr Rosenstein was also present for the very end, standing silently on stage behind Mr Barr two weeks ago when the attorney general cleared the president of obstruction, praised the president's cooperation with the investigation and maintained several times that there had been no collusion between the campaign and Russia.
Rosenstein's exit orderly
In his resignation letter, Mr Rosenstein said most deputies stay in their post for about 16 months; Mr Rosenstein will have served about two years.
"I am grateful to you for the opportunity to serve; for the courtesy and humor you often display in our personal conversations; and for the goals you set in your inaugural address: patriotism, unity, safety, education, and prosperity, because 'a nation exists to serve its citizens,'" Mr Rosenstein wrote.
The deputy attorney general position is a hugely significant job, responsible for overseeing the daily operations of the Justice Department and the work of United States attorneys across the country. Mr Trump has nominated Deputy Transportation Secretary Jeffrey Rosen as Mr Rosenstein's replacement.
Though Mr Rosenstein's exit was orderly, his relationship with the president had waffled over time. His job status appeared perilous last September following news reports that he had discussed secretly recording Mr Trump and invoking a constitutional amendment to remove him from office. He hung on for several more months and appeared to turn the page, at least publicly, after a private meeting with Mr Trump aboard Air Force One.
Mr Rosenstein appointed Mr Mueller after Mr Sessions, who ordinarily would have overseen the investigation, recused himself in March 2017 because of his close involvement in the Trump campaign. The appointment came one week after Mr Trump fired Mr Comey, an action Mr Rosenstein laid the groundwork for by writing a memo that sharply criticized Mr Comey's handling of the Hillary Clinton email investigation.
The White House initially cited the memo as justification for the firing, but Mr Trump has said he was thinking of "this Russia thing" when he fired Mr Comey.
Over the next two years, with Mr Sessions recused from the Russia investigation, Mr Rosenstein set the boundaries of Mr Mueller's investigation, approved investigative steps and, in place of the rarely seen special counsel, twice announced criminal indictments from the Justice Department podium against Russians accused of election interference.
The investigation overshadowed the rest of Mr Rosenstein's work even as he joined Mr Sessions in talking up the president's agenda, including announcements on combating violent crime and opioid addiction.
Rosenstein's position had seemed perilous at times
Mr Rosenstein endured in the job beyond Mr Sessions, but there were moments when his position appeared in the balance.
Mr Trump lamented to The New York Times in July 2017 that "there are very few Republicans in Baltimore," a reference to Mr Rosenstein's prior job as the US attorney in Maryland. Mr Rosenstein was appointed to that position by Republican President George W Bush and remained for the entire Obama administration.
That same summer, Mr Trump tweeted: "I am being investigated for firing the FBI Director by the man who told me to fire the FBI Director! Witch Hunt"
Mr Trump lashed out the following April after the FBI raided the office of his former personal lawyer, Michael Cohen, and months later retweeted the image that showed Mr Rosenstein, Mr Comey and other investigators behind bars.
In September, The New York Times reported that after Mr Comey's firing, Mr Rosenstein and other top law enforcement officials had discussed secretly recording the president to expose chaos inside the White House and invoking the 25th Amendment, which allows the Cabinet to seek the removal of a president deemed unfit for office.
The Justice Department issued statements challenging the reporting, but former FBI Deputy Director Andrew McCabe - who was in the room - has said he got the sense that Mr Rosenstein was "counting votes" about which Cabinet members he could enlist in the effort.
Mr Rosenstein arrived at the White House days after the report that he was expecting to be fired, but he was instead allowed to stay on after private conversations with Mr Trump's then-chief of staff, John Kelly, and the president himself.