Geoffrey Berman, who served as the U.S. Attorney for the Southern District of New York, said in a statement Saturday evening that he will leave his post "effective immediately."
The statement came soon after President Donald Trump sought to distance himself from the firing of Berman, publicly contradicting a letter sent earlier in the day to Berman by Attorney General William Barr who said Trump removed Berman after Barr requested it.
Berman made clear Saturday evening that he opted to leave office effective immediately because Barr decided to "respect the normal operation of law and have Deputy U.S. Attorney Audrey Strauss become Acting U.S. Attorney," instead of Barr's handpicked replacement, Craig Carpenito.
Earlier in the day, Trump told reporters "I'm not involved" when asked about the firing and said "That's all up to the attorney general."
But Barr in his letter said he asked the president to get involved after Berman's release of a statement Friday night in which he contradicted the attorney general saying that Berman was planning on "stepping down" from his position.
"Because you have declared that you have no intention of resigning, I have asked the President to remove you as of today, and he has done so."
The Justice Department didn't immediately respond to a request for comment on the president undercutting Barr's letter.
In his letter, Barr wrote that he was making the move because of Berman's reaction to his attempted firing by Trump on Friday night.
The surprise move by Trump came two years into a tenure that included the prosecution of Michael Cohen, the arrest of Jeffrey Epstein and charges filed against two associates of Rudy Giuliani at the heart of the Ukraine impeachment inquiry.
In his letter Saturday Barr noted that he had offered Berman other positions in the administration, including head of the Civil Division at Main Justice.
But Berman declined the offer and was subsequently fired with Barr assigning Craig Carpenito, the U.S. attorney in New Jersey, to lead the office on an interim basis. It's unclear whether Carpenito will still take over the office effective July 3 with Strauss now taking over for Berman.
Berman issued a statement late Friday saying he had no intention of taking the firing in stride.
"I learned in a press release from the Attorney General tonight that I was 'stepping down' as United States Attorney," he said. "I have not resigned, and have no intention of resigning, my position, to which I was appointed by the Judges of the United States District Court for the Southern District of New York. I will step down when a presidentially appointed nominee is confirmed by the Senate."
"Until then, our investigations will move forward without delay or interruption," he continued. "I cherish every day that I work with the men and women of this Office to pursue justice without fear or favor - and intend to ensure that this Office's important cases continue unimpeded."
Berman pointed out that his appointment in 2018 under law after being confirmed by a panel of district judges dictates that he can only be replaced as U.S. attorney once a new presidential appointment is confirmed by the Senate.
But in his statement Saturday, Berman wrote that "It has been the honor of a lifetime to serve as this District's U.S. Attorney and a custodian of its proud legacy, but I could leave the District in no better hands than Audrey's."
Barr in his letter had said that the president has total authority over U.S. attorneys and has the ability to remove them at his own discretion. Barr's Saturday letter appeared to formalize in writing the administration's initial attempt to remove Berman late Friday night by misleadingly announcing he was "stepping down" effective July 3.
Barr's letter additionally says that office supervisors will be expected to report any instances of inappropriate interference in ongoing cases in the office to the DOJ's Inspector General.
Trump intends to nominate Jay Clayton of the Securities and Exchange Commission to replace Berman.
"The attorney general has known Jay Clayton for years and holds him in high regard," a Justice Department official told ABC News. "Jay was getting ready to leave the administration and go back to New York. He expressed interest in SDNY. The attorney general thought it was a good idea. He offered Berman other positions, including head of the Civil Division at Main Justice. Berman declined. That's that."
Berman's tenure included several politically sensitive investigations, like the case against Trump's former personal attorney, Cohen. He was named the interim replacement for former U.S. attorney Preet Bharara in 2018 by then-Attorney General Jeff Sessions.
Trump failed to nominate him or any other permanent replacement and, after 120 days, the district court appointed Berman to the job.
In refusing to go quietly, Berman declared the office's investigations continue unabated. That would include the investigation into the president's personal lawyer, Rudy Giuliani.
Berman's ouster is likely to send a shockwave through Washington, as it comes ahead of the release of former national security adviser John Bolton's book, in which Bolton details an exchange that Trump had with Turkish President Recep Tayyip Erdogan about the Southern District.
According to Bolton, after Erdogan handed Trump a memo saying that a Turkish firm under investigation by SDNY was innocent, Trump told Erdogan, "he would take care of things, explaining that the Southern District prosecutors were not his people, but were Obama people, a problem that would be fixed when they were replaced by his people."
Additionally, as ABC News has previously reported -- Berman's office is believed to still be actively investigating the president's personal attorney, Giuliani, related to his contacts with Lev Parnas and Igor Fruman -- two central characters in the Ukraine impeachment scandal.
ABC News' Ben Gittleson contributed to this report.