Only two days after defending his role in a brokering a plea deal with the financier and sex-offender Jeffrey Epstein, Alex Acosta announced he is resigning from his role as Labor Secretary. While working as U.S. attorney for Southern Florida, Acosta approved a non-prosecution deal with Epstein which prevented Epstein and four other defendants from being charged with any federal crimes. Instead, Epstein was required to plead guilty to two state prostitution charges, serve jail time, register as a sex offender, and pay restitution to his victims.

Acosta’s role in the Epstein prosecution has been under greater scrutiny this week after Epstein was taken into custody and indicted on sex trafficking charges, in a rebuke to the Acosta deal. Under the terms of the deal, Epstein served only 13 months of an 18-month sentence and was given daily furloughs to his office.

The deal has been under fire since November, when the Miami Herald reexamined the case, prompting a district court judge to rule that the 2008 deal violated the Crime Victims Rights Act because Acosta did not reveal the terms of the deal to Epstein’s victims. An inquiry was opened the same month to formally determine if Acosta’s legal team mishandled the case.

In a statement made before reporters this morning, President Donald Trump lauded Acosta, saying he was a “great Labor secretary, not good” and that his decision to step down was his own, and not forced upon him by anyone in the administration. Trump went on to say that Acosta is a “tremendous talent. A Hispanic man, went to Harvard, a great student.”

Acosta gained favor with Trump, despite being the second choice pick after accused domestic abuser Andy Puzder, with positive monthly reports on the economy and employment. However, Acosta also irked many members of the administration for his conservative and slow-paced deregulation efforts. Acting Chief-of-Staff Mick Mulvaney even required a minimum of three White House aides in agency regulatory meetings.

Ivanka Trump also grew to dislike Acosta after the DOL took two years to issue a regulation outlining a program for privately led apprenticeships.

Exculpatory explanations from Acosta were not enough to save his job. He alleges that in 2008 the all-star Epstein defense team, upon which both Alan Dershowitz and Kenneth Starr worked, launched a “year-long assault on the prosecution and the prosecutors” and attempted to discredit them by digging up “peccadillos.” Acosta also claims that he was not aware of the full extent of the crimes committed by Epstein.