WASHINGTON (AP) — Labor Secretary Alexander Acosta is resigning 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.

President Donald Trump announced the news Friday 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.

Top Democratic lawmakers and presidential candidates had demanded that Acosta resign.

Trump had defended Acosta but said he’d look “very closely” at his handling of the 2008 agreement.

The deal came under scrutiny earlier this year following reporting by the Miami Herald.