Video by USA Today Correction: July 8, 2019 This article has been revised to reflect the following correction: An earlier version of this article misstated the given name of a government lawyer. He is Alexander Rossmiller, not Andrew.

[Read our previous coverage of the arrest of Jeffrey Epstein.]

A trove of lewd photographs of girls, discovered in a safe inside the financier Jeffrey Epstein’s Manhattan mansion the same day he was arrested, is deepening questions about why federal prosecutors in Miami had cut a deal that shielded him from federal prosecution in 2008.

Sign up for the Morning Briefing Newsletter.

Federal prosecutors in Manhattan charged Mr. Epstein on Monday with sex trafficking, dealing an implicit rebuke to that plea agreement, which was overseen by Alexander Acosta, then the United States attorney in Miami and now President Trump’s labor secretary.

The indictment in Manhattan could prompt a moment of reckoning for the Justice Department, which for years has wrestled with accusations that it mishandled the earlier case and has faced a barrage of litigation from Mr. Epstein’s accusers. In February, the Justice Department opened its own internal review into the matter.

Attorney General William P. Barr said on Monday during a trip to South Carolina that he had recused himself from the case because Mr. Barr’s former law firm, Kirkland & Ellis, had represented Mr. Epstein.

Eric Holland, the deputy assistant secretary of labor for public affairs, said on Monday that Mr. Acosta had no comment. The House speaker, Nancy Pelosi, said late Monday night that Mr. Acosta should resign because of the “unconscionable agreement” that he made with Mr. Epstein in 2008.

Late on Tuesday morning, Mr. Acosta, writing on Twitter, defended his actions a decade ago. With the evidence available at the time, he said, his prosecutors had insisted Mr. Epstein go to jail and register as a sex offender. He called the financier’s crimes “horrific.”

“Now that new evidence and additional testimony is available, the N.Y. prosecution offers an important opportunity to more fully bring him to justice,” he wrote.

Accusations of sexual predation have dogged Mr. Epstein for decades. Until his arrest on Saturday, his case had been held up as a prime example of how insulated, powerful men can escape accountability.

Mr. Epstein, a hedge fund manager, avoided the possibility of a lengthy prison sentence, largely because of a secret agreement his lawyers struck with federal prosecutors in 2008. His social circle is filled with the rich and famous, including former President Bill Clinton and Prince Andrew of Britain.

Mr. Clinton’s office said in a statement on Monday that he knows nothing about “the terrible crimes” connected to Mr. Epstein.

In 2002, Mr. Trump described Mr. Epstein as “a terrific guy,” telling New York Magazine, “It is even said that he likes beautiful women as much as I do, and many of them are on the younger side.”

As he unsealed an indictment charging Mr. Epstein with sex trafficking on Monday, the United States attorney in Manhattan, Geoffrey S. Berman, made an appeal to other women who may have been abused by him to come forward.

“They deserve their day in court and we are proud to stand up for them by bringing this indictment,” Mr. Berman said.

He declined to say why his office decided to pursue charges against Mr. Epstein now, since federal prosecutors knew about his potential crimes in New York a decade ago. Mr. Berman said his office had been “assisted by some excellent investigative journalists,” an apparent reference to The Miami Herald’s reporting from November.

The indictment said that Mr. Epstein and his employees engaged in a sex-trafficking scheme, bringing dozens of vulnerable girls, some as young as 14, to his Upper East Side mansion and to his palatial compound in Palm Beach, Fla., between 2002 and 2005.

Mr. Epstein, 66, then engaged in sex acts with the young women during naked massage sessions, paying them hundreds of dollars in cash, prosecutors said. He also asked some of the girls to recruit other girls, many of whom prosecutors say were underage, and paid them for bringing in new victims, the indictment said.

“This conduct, as alleged, went on for years and involved dozens of young girls, some as young as 14,” Mr. Berman said. “The alleged behavior shocks the conscience.”

Mr. Epstein is charged with sex trafficking and sex trafficking conspiracy, and faces a combined maximum sentence of up to 45 years in prison if convicted.

[Read the indictment.]

Mr. Epstein’s lawyer, Reid Weingarten, said the allegations in the indictment had already been settled in 2008. “To us this indictment is essentially a do-over,” he said. “This is old stuff. This is ancient stuff.”

Mr. Epstein, looking disheveled in a navy blue jumpsuit, pleaded not guilty. He stared silently ahead as prosecutors outlined the charges, never glancing at the packed courtroom behind him. He is expected back in court on Thursday.

The discovery of the photo trove was detailed by prosecutors as they argued against allowing Mr. Epstein to be freed on bail. His wealth and means — including six homes and two private jets — made him a significant flight risk, they said.

“He is a man of nearly infinite means,” said Alexander Rossmiller, a government lawyer.

Prosecutors said they seized hundreds, and possibly thousands, of “sexually suggestive” pictures of nude or partially nude young women and girls during a search of Mr. Epstein’s Manhattan townhouse on Saturday, conducted at roughly the same time the financier was arrested at Teterboro Airport in New Jersey.

The cache of photos, some of which were discovered in a locked safe that also contained CDs with labels like “Girl pics nude,” demonstrate the predatory attitude that Mr. Epstein continues to have toward young women, prosecutors said.

“This is not an individual who has left his past behind,” Mr. Rossmiller said.

In the hours since Mr. Epstein’s arrest, prosecutors said, several other women contacted them with complaints about Mr. Epstein. Some of those accusers had never previously spoken to the government, prosecutors said.

Several of Mr. Epstein’s accusers said they were relieved that authorities seemed to be taking their complaints seriously after many years.

“The news of my abuser’s arrest today is a step in the right direction to finally hold Epstein accountable for his crimes,” Sarah Ransome, who said she was forced to have sex with the financier in her 20s, said in a statement read by her lawyer, Sigrid McCawley, outside federal court.

Two other women who have said they were abused by Mr. Epstein when they were teenagers, Courtney Wild and Michelle Licata, watched the proceedings from the back of the courtroom with their lawyer, Brad Edwards. “I was 14. I had braces on,” Ms. Wild told ABC News on Monday.

The charges unsealed Monday mirror those that federal prosecutors had prepared in Miami against Mr. Epstein more than a decade ago. In 2005, law enforcement officials there investigated Mr. Epstein after the parents of one of his accusers reported an incident to the police.

Florida prosecutors had prepared a 53-page indictment accusing Mr. Epstein of being a sexual predator. But those charges were shelved in 2008 after an 11th-hour deal was reached between the United States attorney’s office in Miami and Mr. Epstein’s lawyers.

The agreement granted Mr. Epstein immunity from federal prosecution and let him plead guilty to two prostitution charges in state court. Federal prosecutors arranged for the plea deal to be kept secret from Mr. Epstein’s accusers until it was finalized in court.

The deal let Mr. Epstein avoid a possible life sentence in federal prison. Instead, he spent 13 months at a Palm Beach jail and was permitted to leave the facility six days a week for work. He was also required to register as a sex offender.

Mr. Berman made it clear that his office was not bound by the 2008 agreement that Mr. Acosta’s office had negotiated.

“That agreement, by its terms, only binds the Southern District of Florida,” Mr. Berman said.

The agreement has been examined in a series of articles in The Miami Herald and is being challenged in court. A federal judge ruled earlier this year that Mr. Epstein’s accusers should have been consulted about the deal before it was signed.

Mr. Weingarten, Mr. Epstein’s lawyer, said the agreement was approved at the Justice Department “at a very, very high level.”

The statement issued by Mr. Clinton’s office acknowledged that the former president had taken four trips on Mr. Epstein’s airplane. It also said Mr. Epstein had visited Mr. Clinton’s office in 2002 and Mr. Clinton had visited Mr. Epstein’s apartment in New York with a staff member.

Prosecutors are also seeking the forfeiture of Mr. Epstein’s home on East 71st Street between Fifth and Madison Avenues, which has been called one of the largest townhouses in Manhattan. It has at least seven floors and covers 21,000 square feet.

The government also said in court papers that prosecutors have “real concerns,” based on past experience, that Mr. Epstein, if freed on bail, could attempt to “pressure and intimidate” witnesses, including his accusers and their families.

Over the last six months, detectives and agents with the New York Police Department-F.B.I. Child Exploitation Human Trafficking Task force, working with the prosecutors, were able to identify and interview three victims, whose abuse formed the basis of the indictment, according to a law enforcement official.

The indictment said Mr. Epstein used employees to arrange sexual rendezvous with one of the victims at his New York residence and two others at his home in Palm Beach.

Mr. Epstein is accused of having the girls perform nude massages, at which point he would masturbate and touch their genitals with his hands or with sex toys.

The girls were paid hundreds of dollars in cash for each encounter and, once recruited, were asked to return to the mansion several times, where they were abused again, the indictment said. Mr. Epstein, the court documents read, “created a similar network of minor girls to victimize” in Florida.

“Too often, adults in our society have turned a blind eye to the type of criminal behavior alleged here,” said William F. Sweeney Jr., the assistant director in charge of the New York office of the F.B.I.

Katie Benner, Michael Gold, Edgar Sandoval, William K. Rashbaum and Glenn Thrush contributed reporting.