Labor Secretary Alex Acosta said Friday he will resign amid controversy over the way he handled a sex crimes case against wealthy businessman Jeffrey Epstein a decade ago when he was U.S. attorney for southern Florida.

Acosta made the announcement to reporters while standing next to President Donald Trump outside the White House. Trump said Acosta had called him Friday morning and that it was Acosta's decision to quit.

"This was him, not me, because I'm with him," Trump said in a lengthy exchange with the press before departing the White House en route to events in Wisconsin and Ohio. "I said, 'You don't have to do this.'"

Acosta told reporters that he did not want his involvement in Epstein's controversy to overshadow the administration's accomplishments. Acosta said he will officially resign a week after his announcement. Deputy Labor Secretary Patrick Pizzella will take his place in an acting capacity, Trump said.

Trump TWEET

In his resignation letter to Trump, Acosta said, "It has meant so much to me that you have offered your steadfast support in our private discussions and in your public remarks." But "your agenda, putting the American people first, must avoid any distractions," Acosta wrote.

The resignation came two days after Acosta gave a news conference in which he defended a controversial non-prosecution agreement he had made with Epstein's lawyers in 2007, when Acosta was the top prosecutor in Miami.

The issue resurfaced on July 6, when the politically connected Epstein, whose friends have included Trump and former President Bill Clinton, was arrested on sex trafficking charges by federal prosecutors in New York.