President Donald Trump speaks to members of the media with Secretary of Labor Alex Acosta on the South Lawn of the White House, Friday, July 12, 2019, before Trump boards Marine One for a short trip to Andrews Air Force Base, Md. and then on to Wisconsin. (AP Photo/Andrew Harnik)

WASHINGTON — Labor Secretary Alexander Acosta said Friday he is resigning following renewed scrutiny of his handling of a 2008 secret plea deal with wealthy financier Jeffrey Epstein , who is accused of sexually abusing dozens of underage girls.

President Donald Trump, with Acosta at his side, made the announcement as he left the White House for a trip to Wisconsin and Ohio. The president said "I hate to see this happen" and that he did not ask Acosta to leave the Cabinet. But conservatives unhappy with steps Acosta has taken at the department had been pushing for his ouster.

Trump, who publicly faults the news media nearly every day, said Acosta put the blame for his departure there, too.

The president tweeted from aboard Air Force One that Acosta "informed me this morning that he felt the constant drumbeat of press about a prosecution which took place under his watch more than 12 years ago was bad for the Administration, which he so strongly believes in, and he graciously tendered his resignation."

Acosta was the U.S. attorney in Miami when he oversaw a 2008 non-prosecution agreement that allowed Epstein to avoid federal charges but plead guilty to state charges and serve 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 said his resignation would be effective in seven days. He said he didn't think it was right for his handling of Epstein's case to overshadow the president's agenda and his work as secretary of labor.

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

Top Democratic lawmakers and presidential candidates had demanded that Acosta resign. But Acosta had defended his actions, insisting at a news conference Wednesday that he got the toughest deal on Epstein that he could get at the time.

House Speaker Nancy Pelosi of California said the secretary should never have been appointed by Trump and confirmed by the Senate. "Thank God he's gone," she said

A federal judge said Acosta violated federal law by not notifying Epstein's victims of the plea arrangement. The Justice Department has been investigating.

"We should never allow an official who has been held to break the law by a federal court, to hold an office in the president's Cabinet. His resignation today is hopefully only the first step in holding those accountable," said Spencer Kuvin, a Florida lawyer who represents several Epstein victims.

Acosta had also frustrated some conservatives who had been pushing for his ouster long before the Epstein uproar. Among their objections were Acosta’s decisions to proceed with several employment discrimination lawsuits and to allow certain Obama administration holdovers to keep their jobs.

Trump had initially defended Acosta but said he'd look "very closely" at his handling of the 2008 agreement.

The deal had come under scrutiny earlier this year following reporting by The Miami Herald.

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 Florida state charges, spent 13 months in jail, paid settlements to victims and registered as a sex offender.

Acosta had attempted to clear his name, and held a news conference — encouraged by Trump — 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 had worked in the best interests of Epstein's victims.

"We did what we did because we wanted to see Epstein go to jail," he said. "We believe that we proceeded appropriately."

Pressed on whether he had any regrets, Acosta repeatedly said circumstances had changed since then. He did not answer a question about whether he would resign if the Justice Department were to find misconduct on his part.

"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."

After federal attorneys in New York announced the new charges against Epstein this week, Acosta tweeted that he was pleased by their decision.

"The crimes committed by Epstein are horrific," Acosta tweeted. "With the evidence available more than a decade ago, federal prosecutors insisted that Epstein go to jail, register as a sex offender and put the world on notice that he was a sexual predator."

"Now that new evidence and additional testimony is available, the NY prosecution offers an important opportunity to more fully bring him to justice."

Acosta took office as the nation's 27th labor secretary in early 2017, leading a sprawling agency that enforces more than 180 federal laws covering about 10 million employers and 125 million workers. The department also plays a role in combatting human trafficking.

Trump said Acosta would be replaced by Pat Pizzella, currently the department's deputy secretary.

Before he was named a U.S. attorney, Acosta was an assistant attorney general for the civil rights division in President George W. Bush's first term. Before joining the Trump administration, Acosta was dean of the Florida International University law school.