WASHINGTON (AP) — Deputy Attorney General Rod Rosenstein submitted his resignation Monday after a two-year run defined by his appointment of a special counsel to investigate connections between President Donald Trump's campaign and Russia.

His last day will be May 11, ending a tumultuous relationship with Trump and a tenure that involved some of the most consequential, even chaotic, moments of the president's administration.

When Trump wanted to fire then-FBI Director James Comey, who was overseeing the Russia probe, Rosenstein wrote the memo that the White House used to justify the dismissal. But eight days later, Rosenstein took a step that Trump feared would end his presidency: appointing Robert Mueller as special counsel. The move made Rosenstein the frequent target of Republican wrath and angry Trump tweets and left him repeatedly appearing on the verge of being fired.

Yet in the end, he was largely in Trump's corner.

He joined Attorney General William Barr in determining that Trump had not obstructed the Mueller investigation — reaching a conclusion that Mueller himself pointedly did not make. He defended Barr against criticism that he was spinning Mueller's findings in the president's favor and stood silently behind him as Barr praised Trump's cooperation at a news conference before a redacted version of the report was released.

In his resignation letter to Trump, Rosenstein paid tribute to the Justice Department's accomplishments and to Trump himself, even praising the sense of humor of a man who once retweeted an image that showed Rosenstein and other officials jailed for treason.

"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,'" Rosenstein wrote to Trump.

Rosenstein's departure had been expected following the confirmation of William Barr as attorney general. Barr praised Rosenstein on Monday for having "navigated many challenging situations with strength, grace, and good humor." The White House nominated a replacement for the No. 2 slot, Deputy Transportation Secretary Jeffrey Rosen, weeks ago.

In his resignation letter, Rosenstein said the median tenure for the position is 16 months; Rosenstein will have served about two years by the time he leaves.

Rosenstein had intended to leave around mid-March but stayed on for the completion of Mueller's investigation. He was part of a small group of department officials who reviewed the report and helped shape its public release after Mueller submitted the document last month. Integral to the start of the probe, Rosenstein was also present for the very end. After Mueller didn't reach a conclusion on whether Trump had obstructed the investigation, Barr and the deputy stepped in and determined the evidence wasn't enough to support such an allegation.

The deputy attorney general position is a hugely significant job, responsible for overseeing the Justice Department's daily operations and the work of United States attorneys across the country. But it's largely an anonymous, behind-the-scenes position. Rosenstein even joked about telling one of his daughters when he took the job not to expect to see his picture in the newspapers.

That wasn't the case, though, for Rosenstein, who was thrust into Justice Department drama even before his arrival on the job because of Attorney General Jeff Sessions' earlier recusal from the Russia probe.

The tumult continued in May 2017 when his memo lambasting Comey's handling of the Hillary Clinton email investigation laid the groundwork for the FBI chief's firing, though Rosenstein privately made clear that he was unhappy that the White House publicly characterized the termination as his idea instead of Trump's, according to Mueller's report. Trump later said he would have fired Comey even without the Justice Department's recommendation and that he was thinking of "this Russia thing" at the time.

Rosenstein appointed Mueller one week later, supervised his work and routinely defended the investigation against attacks from congressional Republicans and from Trump, who often blasted the probe as a "witch hunt."

Over the next two years, with Sessions recused from the Russia investigation because of his work on the Trump campaign, Rosenstein set the boundaries of 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 Rosenstein's work even as he talked up the president's agenda, including announcements on combating violent crime and opioid addiction.

"The Department of Justice made rapid progress in achieving the Administration's law enforcement priorities — reducing violent crime, curtailing opioid abuse, protecting consumers, improving immigration enforcement, and building confidence in the police — while preserving national security and strengthening federal efforts in other areas," Rosenstein wrote in his resignation letter.

Though Rosenstein's exit was orderly, and he endured in the job well beyond Sessions, his relationship with the president waffled over time and his job often appeared in the balance.

That was especially true last September after The New York Times reported that he had discussed secretly recording Trump and invoking a constitutional amendment to remove him from office.

The Justice Department issued statements disputing the reporting, but former FBI Deputy Director Andrew McCabe — who was in the room — has said he got the sense that Rosenstein was "counting votes" about which Cabinet members he could enlist in the effort to oust Trump. Rosenstein arrived at the White House days after the news reports expecting to be fired, but he was instead allowed to stay on after private conversations with Trump's then-chief of staff, John Kelly, and the president himself.

The president also lashed out in April 2018 after the FBI raided the office of his former personal lawyer, Michael Cohen, and months later retweeted the image that showed Rosenstein, Comey and other investigators behind bars.

In his resignation letter, Rosenstein made a perhaps oblique reference to those chaotic moments and the media attention surrounding them.

"We enforce the law without fear or favor because credible evidence is not partisan, and truth is not determined by opinion polls," Rosenstein wrote. "We ignore fleeting distractions and focus on the things that matter, because a republic that endures is not governed by the news cycle."


More From WIBX 950