This story was originally published July 9. It has been updated to reflect Labor Secretary Alex Acosta's resignation.

(CNN) Alex Acosta's decision as a US attorney in Florida to let Jeffrey Epstein avoid federal charges of sex trafficking nearly a decade ago has shadowed the Trump administration's labor secretary but has now cost him his job.

Democrats, including House Speaker Nancy Pelosi, had called for Acosta's resignation following the two count indictment announced Monday by prosecutors with the US Attorney's Office for the Southern District of New York accusing Epstein of sex trafficking in New York and Palm Beach, Florida from 2002 to 2005. Epstein, 66, pleaded not guilty to the new charges and faces as much as 45 years in prison if convicted.

Acosta found himself center stage because of a once secret 2007 non-prosecution agreement he reached as US attorney for the Southern District of Florida with Epstein, the multi-millionaire with connections to the highest levels of US politics and business.

The deal was like few others. It covered not only Epstein but also four women who victims allege were involved in his sex trafficking scheme. Court filings reveal Epstein was also under investigation for potential witness tampering after one of his private investigators allegedly forced a victim's father off the road.

The hardball tactics by Epstein and his team of all-star defense lawyers and a politically aware risk-averse prosecutor seemed to collide resulting in this deal that stood out against other sex trafficking cases brought by Acosta's prosecutors.

"I think that they just felt overwhelmed. They shirked their responsibility. They weren't up for the fight. They were afraid," Spencer Kuvin, an attorney for three of Epstein's victims, said of Acosta's prosecutors.

Acosta defended his handling of the case, tweeting that he was pleased "prosecutors are moving forward."

"The crimes committed by Epstein are horrific, and I am pleased that NY prosecutors are moving forward with a case based on new evidence," Acosta wrote in a series of tweets on Tuesday. "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."

The 'deal of a lifetime'

The allegations of sexual trafficking have been public for years: Florida state prosecutors charged Epstein with solicitation of prostitution in July 2006. Victims sued Epstein beginning soon after alleging he coerced them into sexual acts. Then Acosta's office declined to prosecute.

The details and Acosta's personal involvement in striking the secret "deal of a lifetime," was revealed by the Miami Herald last November.

According to the Herald, Acosta met privately and negotiated directly with one of Epstein's lawyers, Jay Lefkowitz, a partner at Kirland & Ellis -- the law firm where Acosta was previously a partner. Ken Starr, another Kirkland attorney who investigated Bill Clinton, was also recruited for Epstein.

After months of negotiating, Acosta's office declined to prosecute Epstein on federal charges of engaging in sexual acts with minors allowing him to avoid potentially decades in prison. In exchange, the financier pleaded guilty in 2008 to two state charges of soliciting prostitution, including with a minor. Epstein was required to register as a sex offender and served 13 months in prison but was able to work for 12 hours a day, six days a week outside of the prison walls.

In the end, the draft 53-page indictment was set aside and Epstein avoided all federal charges. According to the Herald, prosecutors had identified three dozen victims. The victims of his criminal acts were not notified of the deal until after it was inked.

Prosecutors in New York on Monday, citing court documents, revealed additional information about the deal. They wrote in a court filing requesting Epstein be detained that the Florida prosecutors also considered prosecuting Epstein with obstruction or witness tampering charges for, among other things, having Epstein's private investigators force one victim's father off of the road.

"There were discussions between prosecutors and the defendant's then-counsel about the possibility of the defendant pleading guilty to counts relating to 'obstruction,' as well as 'harassment,'" according to the letter filed Monday by the New York prosecutors.

In addition the Florida prosecutors also proposed that Epstein could plead guilty to violating the protection of child victims and child witnesses. "They also discussed a possible obstruction plea that 'could rely on the incident where Mr. Epstein's private investigators followed (redacted) father, forcing off the road," according to Monday's letter.

Investigation begins but victims are in the dark on his deal

The initial Florida investigation began when the parent of one of the victims, a 14-year-old girl, reported Epstein in 2005 to the local police who then brought in the FBI. The state charged Epstein in July 2006. Kuvin, the attorney representing the 14-year-old, says his clients worked with the FBI but he never got the sense that prosecutors were looking to bring a case.

"We told them we were happy to talk to them. My clients were willing to talk to them. Nobody sought out to speak to them, nobody wanted to talk to them. They negotiated the (non prosecution) deal without ever talking to us," said Kuvin, the attorney who represented the girl and two other victims.

Kuval said Epstein and his lawyers "were ruthless" but added that his clients were willing to and did testify in depositions in both civil lawsuits they filed against Epstein and the Florida state criminal case. His clients later settled the civil lawsuit.

Epstein hired the biggest legal names in Washington, New York and Florida and launched a pressure tactic campaign on the victims, including parking outside their homes in tinted-window black SUVs and trying to obtain their medical records, Kuvin alleges. He suspects that they were as aggressive with the prosecutors.

According to the Herald, "Acosta, in 2011, would explain that he was unduly pressured by Epstein's heavy-hitting lawyers — Lefkowitz, Harvard professor Alan Dershowitz, Jack Goldberger, Roy Black, former U.S. Attorney Guy Lewis, Gerald Lefcourt, and Kenneth Starr, the former Whitewater special prosecutor who investigated Bill Clinton's sexual liaisons with Monica Lewinsky."

Not every witness was willing to cooperate, authorities said. In a 2017 court filing prosecutors said during the earlier investigation many victims were troubled and concerned their identities might be made public. "Some were reluctant to talk to the government, and some refused to talk to the government," prosecutors said.

"Informed by these circumstances and the strengths and weaknesses of the case against Epstein, the US Attorney's office sought to resolve the matter in its prosecutorial discretion in a manner that obtained a guaranteed sentence of incarceration for Epstein, that did not subject victims to the scrutiny and travails associated with a trial, that provided victims with the equivalent of uncontested restitution from Epstein, and that guaranteed the sexual offender registration of Epstein, which would help protect other minors throughout the country in the future," prosecutors said in 2017.

Other sex trafficking cases

The deal stands apart from other sex trafficking cases brought under Acosta's watch. In 2007, the same year as Epstein's deal, Acosta's office prosecuted a Florida resident with for sex trafficking of a minor. The defendant, Demond Levail Osley, was sentenced to 30 years in prison.

Two other men were charged with two counts each of sex trafficking of a minor for financial benefit that same year. They served prison sentences. Neither of the cases involved dozens of victims.

Acosta's defense

The Epstein deal has dogged Acosta more recently. During Acosta's March 2017 confirmation hearing for Labor secretary he was asked about a Washington Post story detailing a court hearing in a civil lawsuit that was questioning the non-prosecution agreement.

"At the end of the day, based on the evidence, professionals within a prosecutor's office decide that a plea -- that guarantees that someone goes to jail, that guarantees that someone register generally and that guarantees other outcomes -- is a good thing," Acosta told lawmakers at the time.

Trump on Tuesday came to Acosta's defense saying that "a lot" of people were involved in the 2007 case in addition to Acosta. "I do hear that there were a lot of people involved in that decision. Not just him."

He added, "But you're talking about a long time ago and again it was a decision made, I think, not by him but by a lot of people. So we're going to look at it very carefully," he said.

Acosta also broke his silence since the charges were announced saying Tuesday that he was "pleased" the New York prosecutors brought the case "based on new evidence."

He also defended prosecutors' prior actions in Florida saying, "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."

A federal judge in February found that the Justice Department violated the law by failing to notify victims of the deal. DOJ's Office of Professional Responsibility is looking into whether there was professional misconduct by prosecutors.

CNN's Curt Devine and Evan Perez contributed to this report.