Embattled Secretary of Labor Alex Acosta, who came under fire this week over a decade-old plea deal with sex offender Jeffrey Epstein, is resigning, President Donald Trump said Friday.

Epstein, 66, was arrested over the weekend and charged in the Southern District of New York with sex trafficking dozens of girls, some as young as 14, in New York and Florida. That arrest brought new scrutiny to the earlier plea agreement, which has been widely criticized as too lenient.

Acosta appeared with Trump on the White House South Lawn on Friday morning where he said he had called the president earlier in the day to tell him he was resigning because he didn't want the Epstein situation to become an even bigger distraction.

"I do not think it is right and fair to have this administration's Labor Department have Epstein (as) the focus," he said. "I told him that I felt the right thing was to step aside."

Trump told reporters that the decision for Acosta to quit "was him, not me" and praised him as a "tremendous talent."

Trump added that he felt public opinion over the Epstein deal Acosta oversaw had changed.

"He made a deal that people were happy with, and then 12 years later were not happy with it," Trump said.

The president said he'd tapped Deputy Labor Secretary Patrick Pizzella as the acting director of the agency. Acosta said his resignation will take effect in one week. Pizzella previously served as a member and as acting chairman of the Federal Labor Relations Authority.

In the earlier case, in 2008, Epstein pleaded guilty to procuring a person under 18 for prostitution and felony solicitation of prostitution, which required him to register as a sex offender and serve about a year in a Florida county jail. He was able to leave the jail almost daily for work, and was allowed to have his own private security detail behind bars.

Acosta, who was the U.S. attorney for the Southern District of Florida at the time of the original Epstein criminal case, has faced calls from Democrats to resign his Cabinet post following the latest Epstein charges.

Several Democrats, meanwhile, celebrated Acosta's resignation.

Acosta was never fit to serve in the Cabinet — his departure is the right thing for our country. Now it’s time to focus on finally securing justice for survivors of Epstein’s abuse and getting a Labor Secretary who will stand up for workers and trafficking victims. — Tim Kaine (@timkaine) July 12, 2019

And another Trump cabinet member resigns in a cloud of controversy. https://t.co/JhljifZ9Ln — Cory Booker (@CoryBooker) July 12, 2019

Acosta has taken responsibility by stepping down, but failures & breakdowns in the system that allowed for Epstein’s sweetheart deal still require full investigation & accountability. — Richard Blumenthal (@SenBlumenthal) July 12, 2019

Acosta's office reached the secret non-prosecution deal in 2008 with the wealthy financier to halt the federal sex abuse investigation involving dozens of teenage girls in return for Epstein pleading guilty to lower state charges involving a single victim.

The latest charges against Epstein, however, allege that he trafficked girls during the same time period as the earlier Florida probe.

Federal prosecutors in New York allege the politically connected financier, who has socialized with Trump, former President Bill Clinton and Britain's Prince Andrew, sexually abused dozens of minors and paid his victims to recruit others, allowing him to build a vast network of girls to exploit.

The 2008 agreement with Acosta's office did not protect Epstein from being prosecuted for alleged crimes in parts of the country other than South Florida, according to New York prosecutors, who say their case involves new victims and new evidence, including a cache of incriminating pictures that were found in a vault in Epstein's Manhattan mansion.

Acosta had attempted to defend himself and the deal in a news conference earlier this week, saying that his office intervened in the case only after state prosecutors failed to secure a plea deal that would have resulted in jail time for Epstein and give justice to his victims.

Trump in recent days had repeatedly defended Acosta, calling him an "excellent" secretary of labor and suggesting that multiple officials, in addition to Acosta, were responsible for how the 2008 case turned out.

He has also said that he had a "falling out" with Epstein a number of years ago. He repeated that Friday on the White House South Lawn — but when asked what the falling out was about, replied, "the reason doesn’t make any difference frankly."

At the news conference earlier this week, Acosta said that "times have changed," but also added that his office had "acted appropriately" in making the deal with Epstein.

He also pushed back against an assessment that he violated the law by not informing Epstein's victims about the non-prosecution agreement.

Calling the case "complex," Acosta argued that he and the other federal prosecutors were following Justice Department policy. They waited until they secured the plea deal with a provision that would require Epstein to pay restitution to his victims before notifying them, he said, in case the deal fell apart and the defense tried to use any payments as a way to undermine the victims' credibility.

Acosta also said that he welcomed the actions by New York prosecutors, calling it "the absolutely right thing to do," and added that if Epstein committed crimes in other states, additional charges should be brought.