Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A politically connected multi-millionaire sex offender accused of sexually abusing dozens of teenage girls struck a last-minute deal to avoid a civil trial that would have allowed some of his victims to finally testify against him in open court.

Jeffrey Epstein struck the deal with lawyer Bradley Edwards shortly before jury selection was set to begin in West Palm Beach, Florida.

SIGN UP HERE FOR BREAKING ALERTS FROM NBC NEWS

"What happened today was a win," Edwards, who represents some of Epstein's accusers, told reporters after the deal was announced.

Jeffrey Epstein. Palm Beach Sheriff's Office via AP, file

The deal included a financial settlement, the details of which were kept confidential, NBC Miami reported. It also included an apology from Epstein to Edwards, who'd accused Epstein of trying to ruin his reputation as retaliation for having represented his accusers.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

"While Mr. Edwards was representing clients against me, I filed a lawsuit against him in which I made allegations about him that the evidence conclusively proves were absolutely false. The truth was that his aggressive investigation and litigation style was highly effective and therefore troublesome for me," said Epstein's statement, which was read in court.

"I am now admitting that I was wrong and that the things I said to try to harm Mr. Edwards’s reputation as a trial lawyer were false. I sincerely apologize for the false and hurtful allegations I made and hope some forgiveness for may acknowledgement of wrongdoing."

The apology offered no words of remorse for Epstein's alleged victims, several of whom had been expected to testify in the trial, the Miami Herald reported. The women had been expected to testify that they had been sexually abused and that Edwards hadn't done anything illegal or criminal.

Epstein — a financier who was friends with the likes of Bill Clinton, Donald Trump and Great Britain's Prince Andrew — has been accused of sexually abusing dozens of teenage girls in the early 2000s.

Young girls would be taken to Jeffrey Epstein's home on El Brillo Way in Palm Beach, Florida. Emily Michot / Miami Herald

With a legal team behind him that included Harvard professor Alan Dershowitz and former Whitewater special prosecutor Ken Starr, he was allowed to cop to a state plea to soliciting sex from a minor in 2008.

The deal — which required to him to register as a sex offender and serve 18 months in jail — also secretly ended a sprawling federal probe that could have carried penalties of up to life in prison. The feds had identified over 30 victims, court papers show. The agreement not to prosecute in the federal case was signed off by then U.S. Attorney for Southern Florida — and now-U.S. Secretary of Labor — Alex Acosta.

Epstein was released after spending 13 months in the Palm Beach County stockade, where he'd been allowed to leave to go to work on a daily basis, sometimes not returning until 10 p.m.

Epstein, now 65, has continued living the high-life since his release, enjoying his Florida, New Mexico and New York City estates as well as his own 78-acre private island in the U.S. Virgin Islands.

Some of Epstein's accusers may still have their day in court thanks to a separate case that aims to get Epstein's plea agreement thrown out.

The civil suit by two of the victims charges that prosecutors intentionally violated the federal Crime Victims' Rights Act by keeping them in the dark about the non-prosecution agreement in the federal probe in return for the guilty plea in state court. Edwards is one of the attorneys for the victims in the case, who were 13 and 14 when they say Epstein paid them for sex.

"That injustice needs to be addressed and will be addressed," said lawyer Jack Scarola, who represented Edwards in the suit settled Tuesday. "There is no justification for the broad scope of immunity that was granted."