WASHINGTON — President Donald Trump says Labor Secretary Alexander Acosta is stepping down following criticism of his handling of a plea deal with a wealthy financier Jeffrey Epstein, who is accused of sexually abusing dozens of underage girls.

Trump announced the news with Acosta by his side at the White House as Trump left on a trip to the Midwest.

Acosta says stepping aside was the right decision.

He was the U.S. attorney in Miami when he oversaw a 2008 nonprosecution agreement with Epstein. Epstein avoided federal charges and served 13 months in jail.

Similar charges recently filed against Epstein by federal prosecutors in New York had put Acosta's role in the 2008 deal under renewed scrutiny.

Acosta on Wednesday tried to tamp down calls for his resignation by defending his handling of the case, insisting he got the toughest deal he could at the time.

In a nearly hour-long news conference, Acosta retraced the steps that federal prosecutors took in the case when he was U.S. attorney for the Southern District of Florida a decade ago, insisting that "in our heart we were trying to do the right thing for these victims." He said prosecutors were working to avoid a more lenient arrangement that would have allowed Epstein to "walk free."

"We believe that we proceeded appropriately," he said, a contention challenged by critics who say Epstein's penalty was egregiously light.

The episode reignited this week when federal prosecutors in New York brought a new round of child sex trafficking charges against the wealthy hedge fund manager.

While the handling of the case arose during Acosta's confirmation hearings, it has come under fresh and intense scrutiny after the prosecutors in New York brought their charges on Monday, alleging Epstein abused dozens of underage girls in the early 2000s, paying them hundreds of dollars in cash for massages, then molesting them at his homes in Florida and New York. Epstein has pleaded not guilty to the charges; if convicted he could be imprisoned for the rest of his life.

Acosta insisted his office did the best it could under the circumstances a decade ago. He said state authorities had planned to go after Epstein with charges that would have resulted in no jail time until his office intervened and pressed for tougher consequences, a contention that is supported by the record. The alternative, he said, would have been for federal prosecutors to "roll the dice" and hope to win a conviction.

"We did what we did because we wanted to see Epstein go to jail," Acosta said. "He needed to go to jail."

But Epstein only was given 13 months in a work-release program, which let him work out of the jail six days a week. Acosta said it was "entirely appropriate" to be outraged about that leniency, but he blamed that on Florida authorities. "Everything the victims have gone through in these cases is horrific," he said, while repeatedly refusing to apologize to them.

FILE - This July 27, 2006 arrest file photo made available by the Palm Beach, Fla., Sheriff's Office shows Jeffrey Epstein. Epstein, a wealthy financier and convicted sex offender, has been arrested in New York on sex trafficking charges. Two law enforcement officials said Epstein was taken into federal custody Saturday, July 6, 2019, on charges involving sex-trafficking allegations that date to the 2000s. (AP Photo/Palm Beach Sheriff's Office, File)

AP

"I think it's important to stand up for the prosecutors" in his old office, he said.

His account did not sit well with Barry Krischer, who was the Palm Beach County attorney during the case. Krischer, a Democrat, said Acosta "should not be allowed to rewrite history."

Acosta's South Florida office had gotten to the point of drafting an indictment that could have sent Epstein to federal prison for life. But it was never filed, leading to Epstein's guilty plea to two state prostitution-related charges. In addition to the work-release jail sentence, Epstein was required to make payments to victims and register as a sex offender.

Krischer said the federal indictment was "abandoned after secret negotiations between Mr. Epstein's lawyers and Mr. Acosta." He added: "If Mr. Acosta was truly concerned with the State's case and felt he had to rescue the matter, he would have moved forward with the 53-page indictment that his own office drafted."

Acosta has said he welcomes the new case, and earlier defended himself on Twitter, crediting "new evidence and additional testimony" uncovered by prosecutors in New York for providing "an important opportunity to more fully bring him to justice."

Pressed on whether he had any regrets, Acosta repeatedly suggested that circumstances had changed since the case arose. "We now have 12 years of knowledge and hindsight and we live in a very different world," he said. "Today's world treats victims very, very differently."

Trump has defended Acosta, praising his work as labor secretary and saying he felt "very badly" for him "because I've known him as being somebody that works so hard and has done such a good job."

Trump typically gives his Cabinet secretaries the opportunity to defend themselves publicly in interviews and press conferences before deciding whether to pull the plug. Indeed, he encouraged Acosta to hold Wednesday's press conference laying out his thinking and involvement in the plea deal, according to a senior administration official, speaking on condition of anonymity to discuss internal deliberations.