Secretary of Labor Alexander Acosta is resigning from his post amid scrutiny over a plea agreement he cut with wealthy investor Jeffrey Epstein for sex abuse charges over a decade ago.

President Donald Trump, with Acosta at his side, made the announcement on Friday morning as he left the White House for a trip to Wisconsin and Ohio. The president said Acosta had been a “great” labor secretary.

“I hate to see this happen,” the president said. He said he did not ask Acosta to leave the Cabinet.

Acosta said his resignation would be effective in seven days. Acosta said he didn’t think it was right for his handling of Epstein’s case to distract from his work as secretary of labor.

WATCH: Labor Sec. Alex Acosta announces his resignation amid scrutiny over his role in Epstein plea deal. "I do not think it is right and fair for this administration's Labor Department to have Epstein as the focus, rather than the incredible economy." https://t.co/qd64HSs2qD pic.twitter.com/BIdYlm117G — ABC News (@ABC) July 12, 2019

“My point here today is we have an amazing economy and the focus needs to be on the economy job creation,” Acosta said.

Acosta was the U.S. attorney in Miami when he oversaw a 2008 non-prosecution agreement Jeffrey Epstein. Epstein avoided federal charges, plead guilty to state 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.

President Trump initially defended Acosta and said he would look “very closely” his handling of the 2008 agreement.

Epstein, 66, reached the deal to secretly end a federal sex abuse investigation involving at least 40 teenage girls that could have landed him behind bars for life. He instead pleaded guilty to state charges, spent 13 months in jail, paid settlements to victims and is a registered sex offender.

Acosta held a Wednesday news conference to defend his actions. In a 50-plus-minute lawyerly rebuttal, Acosta argued his office had secured the best deal it could at the time and was working in the victims’ best interests.

“Times have changed and coverage of this case has certainly changed since [2008],” Acosta told reporters. “Facts are important and facts are being overlooked.”

“Simply put, the Palm Beach state attorney’s office was ready to let Epstein walk free, no jail time,” he added. “Prosecutors in my former office found this to be completely unacceptable.”

Democrat congressional leadership called on Acosta exit the administration over the plea deal. House Speaker Nancy Pelosi (D-CA) tweeted late Monday: “.@SecretaryAcosta must step down. As US Attorney, he engaged in an unconscionable agreement w/ Jeffrey Epstein kept secret from courageous, young victims preventing them from seeking justice. This was known by @POTUS when he appointed him to the cabinet.”

The following day, Senate Minority Leader Chuck Schumer (D-NY) echoed the speaker’s comments, accusing the former Miami federal prosecutor of being too lenient with the hedge fund manager.

“Instead of prosecuting a predator and serial sex trafficker of children, Acosta chose to let him off easy,” he said. “This is not acceptable. We cannot have as one of the leading appointed officials in America someone who has done this.”

The Associated Press contributed to this report.