President Donald Trump's labor secretary nominee is facing questions over the unusual plea deal he oversaw for billionaire sex offender, Jeffrey Epstein, while serving as US attorney in Miami.

Alexander Acosta made a deal with Epstein which meant he avoided federal prosecution and a potential life prison sentence when he was found guilty of soliciting prostitution in 2008.

He is now at the center of a lawsuit, which names President Donald Trump as a witness, which accuses him of mishandling the case a decade ago.

Critics, including attorneys for some underage victims of financier Epstein, claim the plea agreement was a 'sweetheart deal' made possible only by Epstein's wealth, connections and high-powered lawyers.

The story resurfaced just hours before his confirmation hearing for the secretary of labor was set to start.

President Donald Trump's labor secretary nominee Alexander Acosta (pictured) is facing questions over the unusual plea deal he oversaw for billionaire sex offender, Jeffrey Epstein, while serving as US attorney in Miami

The lawsuit questions why Acosta, whose confirmation hearing is scheduled to begin Wednesday, cut a deal with Jeffrey Epstein (pictured) 10 years ago rather than pursuing a federal indictment

Trump once called Epstein a 'terrific guy' in 2002, saying that 'he's a lot of fun to be with', adding that 'he likes beautiful women as much as I do, and many of them are on the younger side', according to the Washington Post.

Lawyers told the Post that it's very unlikely Trump will be required to testify in the case.

The lawsuit questions why Acosta, whose confirmation hearing is scheduled to begin Wednesday, cut a deal with Epstein 10 years ago rather than pursuing a federal indictment, according to the Tribune.

Sen Patty Murray, the leading Democrat on the committee, said in a statement that she met with Acosta and is concerned about whether he would 'stand up to political pressure' and advocate for workers as labor secretary.

Acosta has defended his decisions as the best outcome given evidence available at the time.

'Some may feel that the prosecution should have been tougher. Evidence that has come to light since 2007 may encourage that view,' Acosta wrote in a March 2011 letter to media outlets after leaving the US attorney's office.

'Had these additional statements and evidence been known, the outcome may have been different. But they were not known to us at the time.'

Unlike Trump's original choice for labor secretary, Andrew Puzder, Acosta is expected to win confirmation.

The Florida International University law school dean was nominated after Puzder, a fast-food executive, withdrew over his hiring of an undocumented immigrant housekeeper and other issues.

Acosta, 48, has previously won Senate confirmation as Miami US attorney, head of the Justice Department's civil rights division and the National Labor Relations Board.

Trump once called Epstein a 'terrific guy' in 2002. The president is now on the witness list in the Florida court battle over how federal prosecutors handled the allegations against Epstein. But lawyers said it's very unlikely Trump will be required to testify in the case

He declined comment when asked about the Epstein case this week.

Epstein, now 64, pleaded guilty in 2008 to Florida charges of soliciting prostitution and was sentenced to 18 months in prison, of which he served 13 months.

He was also required to register as a sex offender and pay millions of dollars in restitution to as many as 40 victims who were between the ages of 13 and 17 when the crimes occurred.

According to court documents, Epstein paid underage girls for sex, sexual massages and similar acts at a Palm Beach mansion he then owned as well as properties in New York, the US Virgin Islands and New Mexico.

Prosecutors say he had a team of employees to identify girls as potential targets.

After an investigation by local police, Palm Beach prosecutors decided to charge Epstein with aggravated assault, which would have meant no jail time, no requirement that he register as a sex offender and no guaranteed restitution for victims.

Unhappy local investigators went to Acosta's office, which opened a federal probe and eventually drafted a proposed 53-page indictment that could have resulted in a sentence of 10 years to life in prison for Epstein, if convicted.

With that as leverage, a deal was worked out for Epstein to plead guilty to state prostitution solicitation charges and the federal indictment was shelved.

Acosta has defended his decisions as the best outcome given evidence available at the time. 'Some may feel that the prosecution should have been tougher. Evidence that has come to light since 2007 may encourage that view,' Acosta wrote in a March 2011 letter

It didn't stop there. Epstein's lawyers worked out an unusual and secret 'non-prosecution agreement' to guarantee neither Epstein nor his employees would ever face federal charges.

'This agreement will not be made part of any public record,' the deal between Epstein and Acosta says, according to the Tribune. The document was unsealed by a federal judge in a civil lawsuit in 2015.

In his 2011 letter, Acosta defended his decisions as the best possible outcome.

'Our judgment in this case, based on the evidence that was known at the time, was that it was better to have a billionaire serve time in jail, register as a sex offender and pay his victims restitution than risk a trial with a reduced likelihood of success,' Acosta wrote.

'I supported that judgment then, and based on the state of the law as it then stood and the evidence known at the time, I would support that judgment again.'

In the letter, Acosta acknowledged that 'some prosecutors felt that we should just go to trial, and at times I felt that frustration myself.'

Epstein, now 64, pleaded guilty in 2008 to Florida charges of soliciting prostitution and was sentenced to 18 months in prison, of which he served 13 months

He said that Epstein 'received highly unusual treatment while in jail,' including being allowed to serve much of his sentence in the county jail rather than a state prison, and being permitted to leave the jail six days a week to work at home before returning to jail to sleep, according to the Tribune.

'The treatment that he received while in state custody undermined the purpose of a jail sentence,' Acosta said.

Well-known Miami defense lawyer Joel DeFabio, who has represented numerous defendants in sex cases, said he had never heard of such an agreement before Epstein's came to light.

DeFabio said he has had clients with far less egregious sex charges — and far less wealth — who were sentenced to 10 or 15 years behind bars. DeFabio tried to use the Epstein case to argue for more lenient sentences.

'There still has been no clear explanation as to why Epstein received such preferential treatment,' DeFabio said. 'This thing just stinks. The elite take care of their own.'

The non-prosecution agreement became public in a related civil case, leading two Epstein victims — identified only as Jane Does No. 1 and 2, to file a victims' rights lawsuit claiming they were improperly left in the dark about the deal. The lawsuit, which is still pending, seeks to reopen the case to expose the details and possibly nullify the agreement.

Other victims have come forward, including one woman who claimed as a teenager that Epstein flew her around the world for sexual escapades, including encounters with Britain's Prince Andrew. Buckingham Palace has vehemently denied those claims.

The Justice Department's position in the victims' rights lawsuit is that since no federal indictment was ever filed, the victims were not entitled to notification about the non-prosecution agreement. Settlement talks last fall went nowhere.

'There will not be a settlement. That case will eventually get to trial,' said Bradley Edwards, attorney for the two Jane Doe victims.