Sessions told the president in a one-page letter that he was submitting his resignation "at your request."
Trump announced in a tweet that he was naming Sessions' chief of staff Matthew Whitaker, a former United States attorney from Iowa, as acting attorney general. Whitaker has criticized special counsel Robert Mueller's investigation into potential coordination between the president's Republican campaign and Russia.
RELATED: Who is Matthew Whitaker, acting US Attorney General?
The resignation was the culmination of a toxic relationship that frayed just weeks into the attorney general's tumultuous tenure, when he stepped aside from the Mueller investigation.
We are pleased to announce that Matthew G. Whitaker, Chief of Staff to Attorney General Jeff Sessions at the Department of Justice, will become our new Acting Attorney General of the United States. He will serve our Country well....— Donald J. Trump (@realDonaldTrump) November 7, 2018
Trump blamed the decision for opening the door to the appointment of Mueller, who took over the Russia investigation and began examining whether Trump's hectoring of Sessions was part of a broader effort to obstruct justice and stymie the probe.
Asked whether Whitaker would assume control over Mueller's investigation, Justice Department spokeswoman Sarah Flores said Whitaker would be "in charge of all matters under the purview of the Department of Justice." The Justice Department did not announce a departure for Deputy Attorney General Rod Rosenstein, who appointed Mueller more than a year and a half ago and has closely overseen his work since then.
Whitaker once opined about a situation in which Trump could fire Sessions and then appoint an acting attorney general who could stifle the funding of Mueller's probe.
"So I could see a scenario where Jeff Sessions is replaced with a recess appointment and that attorney general doesn't fire Bob Mueller, but he just reduces his budget to so low that his investigation grinds to almost a halt," Whitaker said during an interview with CNN in July 2017.
Asked if that would be to dwindle the special counsel's resources, Whitaker responded, "Right."
In an op-ed for CNN, Whitaker wrote: "Mueller has come up to a red line in the Russia 2016 election-meddling investigation that he is dangerously close to crossing."
The relentless attacks on Sessions came even though the Alabama Republican was the first U.S. senator to endorse Trump and despite the fact that his crime-fighting agenda and priorities - particularly his hawkish immigration enforcement policies - largely mirrored the president's.
But the relationship was irreparably damaged in March 2017 when Sessions, acknowledging previously undisclosed meetings with the Russian ambassador and citing his work as a campaign aide, recused himself from the Russia investigation.
Attorney General Sessions says farewell to the Department of Justice. pic.twitter.com/DVwCr4hH5K— Justice Department (@TheJusticeDept) November 7, 2018
The decision infuriated Trump, who repeatedly lamented that he would have never selected Sessions if he had known the attorney general would recuse. The recusal left the investigation in the hands of Rosenstein, who appointed Mueller as special counsel two months later after Trump fired then-FBI Director James Comey.
The rift lingered for the duration of Sessions' tenure, and the attorney general, despite praising the president's agenda and hewing to his priorities, never managed to return to Trump's good graces.
The deteriorating relationship became a soap opera stalemate for the administration. Trump belittled Sessions but, perhaps following the advice of aides, held off on firing him. The attorney general, for his part, proved determined to remain in the position until dismissed. A logjam broke when Republican senators who had publicly backed Sessions began signaling a willingness to consider a new attorney general.
In attacks delivered on Twitter, in person and in interviews, Trump called Sessions weak and beleaguered, complained that he wasn't more aggressively pursuing allegations of corruption against Democratic rival Hillary Clinton and called it "disgraceful" that Sessions wasn't more serious in scrutinizing the origins of the Russia investigation for possible law enforcement bias - even though the attorney general did ask the Justice Department's inspector general to look into those claims.
The broadsides escalated in recent months, with Trump telling a television interviewer that Sessions "had never had control" of the Justice Department and snidely accusing him on Twitter of not protecting Republican interests by allowing two GOP congressmen to be indicted before the election.
Sessions endured most of the name-calling in silence, though he did issue two public statements defending the department, including one in which he said he would serve "with integrity and honor" for as long as he was in the job.
The recusal from the Russia investigation allowed him to pursue the conservative issues he had long championed as a senator, often in isolation among fellow Republicans.
He found satisfaction in being able to reverse Obama-era policies that he and other conservatives say flouted the will of Congress, including by encouraging prosecutors to pursue the most serious charges they could and by promoting more aggressive enforcement of federal marijuana law. He also announced media leak crackdowns, tougher policies against opioids and his Justice Department defended a since-abandoned administration policy that resulted in parents being separated from their children at the border.
His agenda unsettled liberals who said that Sessions' focus on tough prosecutions marked a return to failed drug war tactics that unduly hurt minorities and the poor, and that his rollbacks of protections for gay and transgender people amount to discrimination.
Some Democrats also considered Sessions too eager to do Trump's bidding and overly receptive to his grievances.
Sessions, for instance, directed senior prosecutors to examine potential corruption in a uranium field transaction that some Republicans have said may have implicated Clinton in wrongdoing and benefited donors of the Clinton Foundation. He also fired one of the president's primary antagonists, former FBI deputy director Andrew McCabe, just before he was to have retired - a move Trump hailed as a "great day for democracy."
Despite it all, Sessions never found himself back in favor with the president.
Their relationship wasn't always fractured. Sessions was a close campaign aide, attending national security meetings and introducing him at rallies in a red "Make America Great Again" hat.
But the problems started after he told senators during his confirmation hearing that he had never met with Russians during the campaign. The Justice Department, responding to a Washington Post report, soon acknowledged that Sessions had actually had two encounters during the campaign with the then-Russian ambassador. He recused himself the next day, saying it would be inappropriate to oversee an investigation into a campaign he was part of.
The announcement set off a frenzy inside the White House, with Trump directing his White House counsel to call Sessions beforehand and urge him not to step aside. Sessions rejected the entreaty. Mueller's team, which has interviewed Sessions, has been investigating the president's attacks on him and his demands to have a loyalist in charge of the Russia investigation.
Sessions had been protected for much of his tenure by the support of Senate Republicans, including Judiciary Committee Chairman Chuck Grassley, who had said he would not schedule a confirmation hearing for another attorney general if Trump fired him.
But that support began to fade, with Grassley suggesting over the summer that he might have time for a hearing after all.
And Republican Sen. Lindsey Graham, another Judiciary Committee member who once said there'd be "holy hell to pay" if Trump fired Sessions, called the relationship "dysfunctional" and said he thought the president had the right after the midterm to select a new attorney general.