Alexander Acosta quit as secretary of labor amid allegations that he helped arrange a lenient plea deal for sex offender Jeffrey Epstein in 2008.

President Donald Trump announced the resignation Friday morning with Acosta at his side. Trump said the secretary called him Friday morning to say the decision to resign was his.

“I thought the right thing was to step aside,” USA Today quoted Acosta as saying.

Trump, who had defended Acosta after Epstein’s arrest last week on sex-trafficking charges, praised him as a “great labor secretary, not a good one,” and added, Acosta did a “very good job.” “This was him, not me,” Trump said of the decision.

In February, a judge in Florida said that federal prosecutors broke the law when they signed a plea bargain with Epstein, a billionaire who was convicted in 2008 of soliciting a teenage girl for prostitution.

Acosta at the time was the U.S. attorney in Miami, and he helped negotiate a plea agreement that gave Epstein, who is Jewish, and his co-conspirators immunity from federal prosecution, according to the Miami Herald.

The ruling in February by U.S. District Court Judge Kenneth Marra culminated more than a decade of litigation stemming from a lawsuit filed in 2008 by two of Epstein’s victims.

Marra wrote that the prosecutors, including Acosta, concealed information from victims of Epstein, who had been operating an international sex operation involving underage girls in Florida and overseas.