Geoffrey Berman, who oversaw the criminal prosecutions of President Donald Trump's associates and foes, has resigned as U.S. attorney for the Southern District of New York, according to a statement from the Justice Department.

After the sudden announcement by U.S. Attorney William Barr, President Donald Trump named Jay Clayton, chairman of the Securities and Exchange Commission, as his choice to take over the Manhattan federal prosecutor's office.

But Berman said in a statement contradicted the resignation narrative.

"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," Berman said. "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. 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 said in his statement that he only learned of the move when he read the press release from Main Justice.

Barr said in the statement that Craig Carpenito, the U.S. attorney for New Jersey, will become the top federal prosecutor in Manhattan as acting U.S. attorney. Carpenito will take over the office's operations, beginning July 3, according to the statement.

Clayton, Trump's choice for U.S. attorney,  was a former partner in Sullivan & Cromwell, where he represented an array of prominent companies and Wall Street banks.

"Under Chairman Clayton's leadership, the SEC filed a total of 1,683 enforcement actions in fiscal years 2018 and 2019," Trump's statement said. "Parties in the Commission's actions and proceedings were ordered to pay a total of $8.294 billion in disgorgement of ill-gotten gains and penalties, and the Commission returned a total of $1.991 billion to harmed investors."

Barr's statement implied that Berman will stay on only until July 3 when Carpenito is set to take over.

Barr said Carpenito "will work closely with the outgoing United States Attorney to ensure a smooth transition."

Berman leaves after 30 months at the helm of the Southern District.

"With tenacity and savvy, Geoff has done an excellent job leading one of our nation's most significant U.S. Attorney's Offices, achieving many successes on consequential civil and criminal matters," Barr said in the statement.

The suddenness of the announcement shocked ex-prosecutors and defense lawyers.

Jaimie Nawaday, a former prosecutor in the Southern District, said Friday night that the announcement came as a "complete shock to everyone."

"This is unexpected news to say the least," she said.

Berman, a Republican, leaves after 30 months at the helm of the Manhattan U.S. attorney's office. A former assistant U.S. attorney in the Southern District, Berman worked in private practice until he was appointed to head the office in an interim capacity following Trump's abrupt firing of Preet Bharara in 2017.

He was voted into the post of Southern District U.S. Attorney by the district's judges in 2018. By law, he could serve until a presidential appointee could be confirmed.

While in office, he oversaw the prosecution of Michael Avenatti, a high-profile attorney who gained notoriety for his representation of an adult film star who accused Trump of engaging in an extramarital affair, an accusation which he has repeatedly denied.

He declared a conflict in the prosecution of Michael Cohen. Trump's former personal lawyer and "fixer." Robert Khuzami, Berman's top deputy, piloted that prosecution, which resulted in Cohen's conviction.

Berman's office had also charged Lev Parnas and Igor Fruman, Soviet-born associates of Rudy Giuliani, a former New York City mayor. Parnas and Fruman have been accused of campaign finance fraud. Trial in that case is scheduled for later in the fall. His office was also reported by The New York Times to be investigating Giuliani, who has served as an attorney to Trump.

Berman also leaves behind an open investigation into an alleged child sex-trafficking ring spearheaded by Jeffrey Epstein, the deceased financier who killed himself last year while awaiting trial in the Southern District.

"He was respected as even-handed and fair, and I suspect that cost him, unfortunately," said Nawaday, a partner in Kelley Drye & Warren.