President Trump asked for Attorney General Jeff Sessions to resign after learning there would be a special counsel investigating his campaign's ties to Russia, and following a humiliating dressing down in the Oval Office, Sessions sent a letter of resignation — however, the president ultimately did not accept it.

According to the New York Times, the president was so upset with Robert Mueller being appointed special counsel that he berated Sessions in the Oval Office during a May meeting.

White House Counsel Donald McGahn received a call from Deputy Attorney Rod Rosenstein saying he had appointed Mueller to be a special counsel for the investigation. McGahn then told the Trump, Sessions and administration advisers, who were in the process of discussing a replacement for fired FBI chief James Comey.

Trump went on to berate Sessions — who had recused himself from the investigation and thus paved the way for a special counsel — by calling him an "idiot" and saying choosing him to be attorney general was one of the "worst" decisions he had made. He then demanded Sessions resign.

According to the report, Sessions was "emotional" when he left that Oval Office meeting, agreeing to resign. Later that night as the Justice Department publicly announced the appointment of Mueller, Sessions wrote his short letter of resignation.

Meanwhile, Vice President Mike Pence, then-White House chief strategist Steve Bannon and then-Chief of Staff Reince Preibus intervened and convinced Trump to allow Sessions to stay.

Sessions allegedly told his associates following the Oval Office incident "that the demeaning way the president addressed him was the most humiliating experience in decades of public life."

According to the Times, Trump returned Sessions' resignation letter to him — which included a handwritten response.

Trump on Thursday denied that he asked Sessions to resign when asked by press after returning to Washington from a trip to Florida.

Trump did take his criticism of Sessions public soon after the May meeting, telling the Times in a July interview that he never would have appointed Sessions to be attorney general if he knew he would recuse himself from the investigation.

Sessions should have never recused himself, and if he was going to recuse himself, he should have told me before he took the job and I would have picked somebody else," Trump said at the time.

That interview paved the way for more public bashing of Sessions, including calling him "weak" and "beleagured" on Twitter.

Sessions ultimately never resigned, nor was he fired, and in the months following the tension between the two, Sessions has been carrying out major policy changes as leader of the Justice Department once promised by the president during his campaign.

Last month, Sessions himself announced the Trump administration would slowly rescind Deferred Action of Childhood Arrivals program, an Obama-era program which Sessions had long been opposed to.