President Donald Trump’s labor secretary nominee, Alexander Acosta, is facing criticism for what many see as him having once cut a deal with a billionaire accused of sexually abusing dozens of teenage girls, which allowed the man to serve just months in prison when he had been facing the possibility of life behind bars.

Acosta, whose Senate confirmation hearing began Wednesday, was serving as a U.S. attorney in Miami when, in 2007, he reacheda non-prosecution deal with financier Jeffrey Epstein, instead of pursuing a federal indictment against the wealthy money manager, according to court papersobtained by the Washington Post.

Under the deal, Epstein — who had been accused of sexually abusing at least 40 women and girls, most of whom were between 13 and 17 years old — pleaded guilty in 2008 to a single state charge of solicitation of underage girls. He described the scenarios as paid sex acts with consenting partners who he believed were of age.

Epstein wassentenced to 18 months in prison, served 13, registered as a sex offender, and paid restitution to his victims. Had he been convicted of the federal charges that Acosta had declined to pursue, Epstein would have faced up to life in prison.

A pending civil lawsuit since filed on behalf of two of Epstein’s alleged victims questions the light charges and punishment against the billionaire as well as Acosta’s handling of the case. The then-U.S. attorney’s own staff had advocated internally for a federal indictment.

“That wasn’t an appropriate resolution of this matter,” former Palm Beach police chief Michael Reiter said in a deposition for the civil suit, calling the state charge against Epstein “very minor.”

Acosta, who has served as the dean of Florida International University’s College of Law since 2009, explained his decision not to pursue federal charges against Epstein in a 2011 letter to the media, saying that the case against him grew stronger only after the deal went through because more victims came forward afterward.

“The bottom line is this: Mr. Jeffrey Epstein, a billionaire, served time in jail and is now a registered sex offender. He has been required to pay his victims restitution, though restitution clearly cannot compensate for the crime,” he wrote.

Backed by ‘an army of legal superstars’

Epstein, a former partner at Bear Stearns, founded hisown money management firm, J. Epstein & Co., in 1982, managing fortunes upward of $1 billion for his ultra-wealthy clients. Through his work, he garnered a pool of rich and famous friends, including former President Bill Clinton and actor Kevin Spacey. President Trump even called Epstein a “terrific guy” in 2002.

Epstein came under investigation in 2005, when a 14-year-old girl told police in West Palm Beach that she had been paid to strip naked andmassage the billionaire and then was allegedly subjected to a non-consensual sex act.

During the investigation, officials identified about 40 teenagers who they claimed Epstein paid for sex and erotic massages in his mansions in Florida, New York City, and the U.S. Virgin Island between 1999 and 2005. Epstein claimed that he believed all the women were of age and insisted all sex acts were consensual.

The money manager hired a trove of high-profile attorneys — “an army of legal superstars,” as Acosta once put it — to defend him. Among them were Kenneth Starr, who led the investigation that ultimately spurred the impeachment of former President Bill Clinton, and Roy Black, who has represented a slew of celebrities, from Rush Limbaugh to Justin Bieber.

Acosta claimed that Epstein’s legal team waged “a year-long assault on the prosecution and the prosecutors” and his office eventually backed off from pressing charges, leaving Epstein pleading guilty to the single state charge.

“Some prosecutors felt that we should just go to trial, and at times I felt that frustration myself,” Acosta wrote in his 2011 letter about the case.

A tense confirmation hearing

Acosta is Trump’s second pick to head up the Department of Labor. His first, businessman Andre Puzder,withdrew his nomination in February amid growing outcry from senators who condemned the fact that he once employed an undocumented immigrant as a housekeeper.

The Trump administration likely believed Acosta’s Senate confirmation hearing would be a breeze, since it would behis fourth: He previously won Senate approval for a job on the National Labor Relations Board, as head of the Justice Department’s Civil Rights Division, and as Miami’s U.S. attorney.

But the Wednesday hearing grew tense as Acosta faced questions about how he handled the Epstein case. Sen. Tim Kaine (D-Va.) asked Acosta why he went through with the deal — even as prosecutors in his office pushed for federal charges.

Acosta reiterated that Epstein served prison time and registered as a sex offender and pointed out that it was unusual (but “necessary” in this case) for a federal office to get involved with a state case.

“If that were done, the federal interest would be satisfied and we would defer to the state,” he said.

Ahead of the hearing, Sen. Elizabeth Warren (D-Mass.)wrote a 23-page letter posing dozens of demanding questions to Acosta, including one asking if he believes Trump should “fully divest” from the Trump Organization (a move that Democrats and ethicistshave long demanded).

Warren continued the aggressive questioning in person at the Wednesday hearing, repeatedly asking Acosta if he’d uphold a rule that protects workers from cancer-causing silica dust amid Trump’s demand that departments review all — and possibly remove some — federal regulations. Acosta would not commit to keeping it in place.

At least 51 senators must vote yes to approve Acosta’s nomination. If confirmed, he’ll be the first Latino in Trump’s cabinet.